Problem:- https://mirror.codeforces.com/edu/course/2/lesson/4/1/practice/contest/273169/problem/C
My submission:-https://pastebin.com/GGeGnBdT or https://ideone.com/VNbvP0
It is giving WA on test case 14 again and again.
Plz can anyone tell where is bug in my code.Any help would be appreciated.