https://codeforces.com/contest/915/submission/79088546