Greetings to everybody.
Today is an unusual day on Codeforces: two contests a day with quite small gap between them. The reason is that today the IX Regional team school programming contest is held in Saratov, and it was decided to use the tasks from it for Codeforces rounds.
That's why there are many authors of today's tasks. I would like to thank the whole jury of the school contest for their excellent job. The following people are on the jury: Artem Rakhov, Nickolay Kuznetsov, Natalia Bondarenko, Gerald Agapov, Polina Bondarenko, Ivan Fefer, Edvard Davtyan, Igor Kudryashov, Pavel Kholkin and me. I believe that you know all these people as Codeforces problemsetters.
Let me draw your attention to the fact that today all problems have file IO. But generators for the hacks should output to stdout as usual.
Special thanks to Maria Belova and Julia Satushina for translating problem statements into English.
Good luck at the contests!
UPD: Results of the 36th round.