https://codeforces.com/contest/1011/problem/A