Code efficiency

can we do this more efficiently

https://codeforces.com/problemset/problem/1360/B

no, i think this is good