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://mirror.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.
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.