https://codeforces.com/contest/1027/problem/E