Codeforces Round 524 (Div. 2)

似乎仍然不是很难。 ...