ratingproblems - bradendubois/competitive-programming GitHub Wiki

Rating Problems

ID: ratingproblems

Difficulty: 1.3

CPU Time: 1 second

Memory: 2048 MB

Solution

For this, add up the k given ratings. The remaining n-k ratings could be (at worst) all -3, or (at best) +3, so the range is (the given ratings minus (3 * n-k)) / n to (the given ratings plus (3 * n-k)) / n.