Codeforces Round 1080 (Div. 3) Upsolving (finished)