time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Anton is growing a tree in his garden. In case you forgot, the tree is a connected acyclic undirected graph. There are n vertices in the tree, e…
time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard output Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that plays chess. However, he finds the…
time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard output Anton is playing a very interesting computer game, but now he is stuck at one of the levels. To pass to the next level he has to prepare n potio…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Recently Anton found a box with digits in his room. There are k2 digits 2, k3 digits 3, k5 digits 5 and k6 digits 6. Anton's favorite integers ar…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Anton likes to play chess, and so does his friend Danik. Once they have played n games in a row. For each game it's known who was the winner - An…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Anton loves transforming one permutation into another one by swapping elements for money, and Ira doesn't like paying for stupid games. Help them…