https://codeforces.com/contest/1082/submission/78458926