Hi everyone.

The today's contest is presented by us: cerealguy and yaro. We used to study in school together and Volodya studied there with us. So he will be the contest's hero: Volodya is going to cook in a kitchen, visit a museum, try to crack a safe, travel to an unusual city and even use his magical abilities.

We are grateful to the Codeforces team and especially to Artem Rakhov who helped us to prepare the contest and wrote alternative solutions.

We hope problems will suit your taste.

Good luck!

Update: Solutions

The today's contest is presented by us: cerealguy and yaro. We used to study in school together and Volodya studied there with us. So he will be the contest's hero: Volodya is going to cook in a kitchen, visit a museum, try to crack a safe, travel to an unusual city and even use his magical abilities.

We are grateful to the Codeforces team and especially to Artem Rakhov who helped us to prepare the contest and wrote alternative solutions.

We hope problems will suit your taste.

Good luck!

Update: Solutions

also in chess you cant kill a piece with a king if it is defended by another same color piece.

If someone has test 7 for problemC(yes, 7 was my unlucky number today) It would be great.

Thanks in advance, and thanks to the setters for the nice problems!!!!

c2 b3 h8 a1 OTHER

Thanks for taking the time man. I guess I should have spent that last ten minutes testing trying to hack myself instead of trying to hack others :).

http://codeforces.com/profile/tourist

I think greedy works here.

-If you have an even number > 1 between two odd numbers -> -1

-If you have an odd number > 1 between two even numbers -> -1

If you don't then you must either:

1)do a division, or

2) a sum and a division

for any pair of numbers that need it.

repeat this until you end with 1 1 1 1

While you have a number different from 1:

1) Find the maximal number.

2) If it is even and has an even neighbour, divide. Otherwise, if it is odd and has an odd neighbout, increase them both, otherwise increase and any of it's neighbours.

Why does it work: Each time before you divide, the total sum increases by 4 (after you make 2 additions, you're guaranteed to divide). So, with each division the total sum decreases (compared to the sum after the previous division) unless the biggest number is 4 and is surrounded by 2 odd ones. Those are not many cases, I just wrone the program and tested all of them - received answers on all. If anyone can give a better proof, you're welcome.

a_{i}to vertices and the lengthsa_{i}+a_{j}to edges. Then the condition about hamiltonian cycles will be fulfilled. To ensure the condition about different lengths, just choose the numbersa_{i}one by one so that it was always true thata_{i}+a_{j}≠a_{i'}+a_{j'}. In other words, when you choose a new number, it mustn't be equal toa_{i}+a_{j}-a_{k}anda_{i}-a_{j}-a_{k}, for any already chosena_{i},a_{j}anda_{k}. It turns out that ifn≤ 20, this process never needs numbers more than 500, so all edges have lengths less than 1000.Borscht aint Russian traditional soup. It originates from Ukraine

Russia and Ukraine still have no cultural border.

There are more differences between eastern and western Ukraine then between eastern Ukraine and Russia.