Rode
For many years now, inhabitants of a village called Navrhbrdovo have problems with storks. As we all know, with the spring come also the storks, bringing babies with them. The village of Navrhbrdovo is situated at the peak of a hill - a very tall one - so by the time they arrive, the storks get completely exhausted. Lately, they are employing lousy storks in "Baby Komerc" company and sometimes a stork drops a baby! To cope with such troublesome events, the villagers of Navrhbrdovo have installed radars on tops of their roofs so they can detect storks and watch them closely. But alas! The radars on some of the houses are interrupting some other radars which are placed on lower roofs to the right side of the house (storks always come from the right side of the village so all the radars are directed to the right).
Artisan Ivica has offered to install ProtivOmet-2011 (to nullify the interruptions) on all the roofs, and he will charge 1 KM for every pair of radars in conflict.
5
3 2 2 2 1Output
7 KM5
1 2 3 4 5Output
0 KMSubmit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.