Codeforces 362C

codeforces

#1

Please tell me this problem.http://codeforces.com/contest/362/problem/C
I am not able to solve it even after reading the editorial.