| Codeforces Round 1067 (Div. 2) |
|---|
| Finished |
A game is being played which initially consists of $$$n$$$ players. On fouls, the referee is allowed to award yellow and red cards. The total number of yellow cards $$$y$$$ and red cards $$$r$$$ awarded to players is known for the game.
There are $$$2$$$ ways a player can be suspended:
Once a player is suspended, they are removed from the game and can't receive any more cards. Determine the maximum number of players suspended from the game possible.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of the test cases follows.
The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 100$$$).
The second line of each test case contains two integers $$$y$$$ and $$$r$$$ ($$$0 \le r \le n$$$, $$$0 \le y + r \le 2n$$$).
For each test case, print one line containing a single integer — denoting the maximum number of players suspended from the game possible.
531 220 046 033 31011 5
203310
For the first test case:
For the second test case:
For the third test case:
| Name |
|---|


