https://codeforces.com/contest/1103/submission/51437716