If we put type-c monkeys first, type-a monkeys or type-b monkeys may not be able to have seats.
for _ in range(int(input())):
= map(int, input().split())
m, a, b, c
int = min(a, m)
a_seated: int = min(b, m)
b_seated:
int = a_seated + b_seated + min(c, 2 * m - a_seated - b_seated)
ans: print(ans)
_ lb
TODO: