https://codeforces.com/contest/1452/submission/99678946