Fifth round Marathon

puzzle

Time limit: 10 sec

Memory limit: 256 MiB
The statement of task #1 in round 5 / 2016 can be downloaded from here
Partners
https://www.uni-ruse.bg/
https://www.president.bg/
https://www.uni-sofia.bg/
https://tu-sofia.bg/
https://www.aubg.edu/