See the original article https://dyingdown.github.io/2019/11/17/AtCoder-4870-Attack-Survival/
Attack Survival
Problem Statement
Takahashi has decided to hold fastest-finger-fast quiz games. Kizahashi, who is in charge of making the scoreboard, is struggling to write the program that manages the players’ scores in a game, which proceeds as follows.
A game is played by N N N players, numbered 1 1 1 to N N N. At the beginning of a game, each player has K K K points.
When a player correctly answers a question, each of the other N − 1 N-1 N−1 players receives minus one $(−1) $point. There is no other factor that affects the players’ scores.
At the end of a game, the players with 0 points or lower are eliminated, and the remaining players survive.
In the last game, the players gave a total of Q Q