I'm a Pascal writer. I can't solve B then I go read the solution of problem B in FPC and saw about 6 A/C by the same code: https://mirror.codeforces.com/contest/1730/submission/173489911 https://mirror.codeforces.com/contest/1730/submission/173487790 https://mirror.codeforces.com/contest/1730/submission/173487187 https://mirror.codeforces.com/contest/1730/submission/173486665 https://mirror.codeforces.com/contest/1730/submission/173482185 https://mirror.codeforces.com/contest/1730/submission/173454097
MikeMirzayanov