This year at Monsters University it is decided to arrange Scare Games. At the Games all campus gathers at the stadium stands, and the Scare program students div...
Grisha N. told his two teammates that he was going to solve all given problems at the subregional contest, even if the teammates wouldn’t show up at the competi...
Alice lives in the country where people like to make friends. The friendship is bidirectional and if any two person have no less than k friends in common, they ...
The vast power system is the most complicated man-made system and the greatest engineering innovation in the 20th century. The following diagram shows a typical...
According to rules of the Berland fashion, a jacket should be fastened by all the buttons except only one, but not necessarily it should be the last one. Also i...
Edward, the emperor of the Marjar Empire, wants to build some bidirectional highways so that he can reach other cities from the capital as fast as possible. Thu...
A. Help Vasilisa the Wise 2 time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Vasilisa the Wise fro...