Problem help ..
https://codeforces.com/contest/279/problem/B
may anyone tell me what is the problem with logic
https://codeforces.com/contest/279/submission/88946134