Here is the solution link.
https://codeforces.me/contest/1625/submission/229144224
But suddenly Codeforces was giving "wrong output format Unexpected end of file — int32 expected (test case 4481)". I'm not familiar with this. Can anyone plz explain it ?I'm so sad about it.



