[Solution] It is My Serve CodeChef Solution | CodeChef Problem Solution 2022
Alice and Bob are playing a game of table tennis where irrespective of the point scored, every player makes consecutive serves before the service changes. Alice makes the first serve of the match. Therefore the first serves will be made by Alice, then the next serves will be made by Bob and so on.
Let's consider the following example match for more clarity:
- Alice makes the serve.
- Let us assume, Bob wins this point. (Score is for Alice and for Bob)
- Alice makes the serve.
- Let us assume, Alice wins this point. (Score is for Alice and for Bob)
- Bob makes the serve.
- Let us assume, Alice wins this point. (Score is for Alice and for Bob)
- Bob makes the serve.
- Let us assume, Alice wins this point. (Score is for Alice and for Bob)
- Alice makes the serve.
- And the game continues
After the score reaches and for Alice and Bob respectively, both the players forgot whose serve it is. Help them determine whose service it is.
Input Format
- The first line contains a single integer — the number of test cases. Then the test cases follow.
- The first line of each test case contains two integers and — the score of Alice and Bob respectively.
Output Format
For each test case, determine which player's (Alice
or Bob
) serve it is.
You may print each character of Alice
and Bob
in uppercase or lowercase (for example, Bob
, BOB
, boB
will be considered identical).
No comments:
Post a Comment