Codeforces Round 1112 Upsolving (finished)