I am trying to solve — http://codeforces.me/problemset/problem/721/C. Here is my submission — http://codeforces.me/contest/721/submission/22405854
I can't find what is wrong. I tried all small test cases (from codeforces) and it produced the right answer. Please Help!!