CF 2184D - Unfair Game

Rating: 1600
Tags: combinatorics, dp, math
Solve time: 2m 38s
Verified: no

Solution

Working