Problem:- https://codeforces.net/edu/course/2/lesson/4/1/practice/contest/273169/problem/C
My submission:-https://pastebin.com/GGeGnBdT
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.