https://codeforces.com/contest/1098/submission/47991143