I am trying to solve http://mirror.codeforces.com/problemset/problem/551/B but when I submit the solution I get wrong answer...so to check again I went to ideone and checked the output for that test case and I get correct answer any suggestions?
Link to codeforces solution http://mirror.codeforces.com/contest/551/submission/11634884
Link to ideone solution http://ideone.com/3xgM8v