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…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Running with barriers on the circle track is very popular in the country where Dasha lives, so no wonder that on her way to classes she saw the…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output After overcoming the stairs Dasha came to classes. She needed to write a password to begin her classes. The password is a string of length n whi…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output After overcoming the stairs Dasha came to classes. She needed to write a password to begin her classes. The password is a string of length n whi…