https://codeforces.com/contest/1155/submission/78603760