NOI 2020 Preliminary Contest

3 hours, 3 tasks, 300 points. Have fun!