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