Why WA? have any critical input, please?
problem : http://mirror.codeforces.com/contest/714/problem/B code : http://pastebin.com/bD9sBRgT
Leetcode Weekly 498 Solution Discussion