Innopolis Open 2018-19 analysis | IOI preparation #1

I will describe solutions of problems from programming competition Innopolis Open 2018-2019. Contest link: https://codeforces.com/gym/102128 Statements: https://codeforces.com/gym/102128/att... Frequently Asked Questions: https://github.com/Errichto/youtube/w... Github repository: https://github.com/Errichto/youtube Facebook:   / errichto   Twitter:   / errichto   Competitive Programming Discord: https://discordapp.com/invite/UzaURu7 Youtube channel 1:    / errichto   (mainly short videos) Youtube channel 2:    / errichto2   (streams) I’m Kamil Dębowski, better known as Errichto. I compete in and organize programming competitions. I make educational streams on Youtube and Twitch. I'm a finalist of ACM-ICPC, Topcoder Open, Facebook Hacker Cup and Google Code Jam. I got a second place in Google Code Jam 2018. I am/was nutella in Codeforces and target in Topcoder. Watch me if you want to practice for coding interviews, competitive programming or just algorithms in general. I share my thought process, explain everything, and mention similar problems and techniques/algorithms.