Codeforces Round 1064 (Div. 2) Upsolving (finished)