- محدودیت زمان: ۱ ثانیه
- محدودیت حافظه: ۲۵۶ مگابایت
Amin and Niloufar are playing Rock-Paper-Scissors together. They are not kids, so instead of playing with their hands, they use actual rocks, papers, and scissors.
Amin has rocks, papers, and scissors. Similarly, Niloufar has rocks, papers, and scissors.
In each round of the game, both players use one of their rocks, papers, or scissors (if a player has no items left, they'll lose that round). According to the traditional rules of this game, paper beats rock, scissors beat paper, and rock beats scissors. If both items are the same, the round is a draw.
Each win earns points, draw earns point, and lose earns no points. Your task is to write a program to calculate the maximum score that Amin can achieve among all possible outcomes.
ورودی
The first line of input contains an integer , representing the number of test cases.
In the first line of each test case, three integers , , and are given. In the second line of each test case, three integers , , and are given.
خروجی
For each test case, print a single integer representing the maximum score Amin can achieve.
مثالها
ورودی نمونه ۱
خروجی نمونه ۱
ارسال پاسخ برای این سؤال