Codechef•Jul 24, 2025
Who is taller!
Hazrat Ali
Codechef
Charlie measured the heights of Alice and Bob, and got to know that Alice's height is X centimeters and Bob's height is Y centimeters. Help Charlie decide who is taller.
It is guaranteed that X≠Y.
Input Format
- The first line of input will contain an integer T — the number of test cases. The description of T test cases follows.
- The first and only line of each test case contains two integers X and Y, as described in the problem statement.
Output Format
For each test case, output on a new line A if Alice is taller than Bob, else output B. The output is case insensitive, i.e, both AA and aa will be accepted as correct answers when Alice is taller.
Constraints
- 1≤T≤1000
- 100≤X,Y≤200
- X≠Y
Sample 1:
Input
2 150 160 160 150
Output
B A
Solution
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int a, b;
cin >> a >> b;
if (a > b)
cout << "A" << endl;
else
cout << "B" << endl;
}
return 0;
}