Help on solving a task
Hello!
Can you explain me the idea behind the solution for task B here: http://mirror.codeforces.com/gym/100234 ?