CodechefAug 19, 2025

Bidding

Hazrat Ali

Codechef

Alice bids A rupees, Bob bids B rupees, and Charlie bids C rupees (where AB, and C are distinct).

According to the rules of the auction, the person who bids the highest amount will win the auction.
Determine who will win the auction.

Input Format

  • The first line contains a single integer T — the number of test cases. Then the test cases follow.
  • The first and only line of each test case contains three integers AB, and C, — the amount bid by Alice, Bob, and Charlie respectively.

Output Format

For each test case, output who (out of AliceBob, and Charlie) will win the auction.

You may print each character of AliceBob, and Charlie in uppercase or lowercase (for example, ALICEaliCeaLIcE will be considered identical).

Constraints

  • 1≤T≤1000
  • 1≤A,B,C≤1000
  • AABB, and CC are distinct.

Sample 1:

Input
4
200 100 400
155 1000 566
736 234 470
124 67 2
Output
Charlie
Bob
Alice
Alice

Solution

#include <bits/stdc++.h>
using namespace std;

int main() {

    int t;
    cin >> t;
    while (t--) {
        int a, b, c;
        cin >> a >> b >> c;
        if (a > b && a > c) {
            cout << "Alice\n";
        } 
        else if (b > a && b > c) {
            cout << "Bob\n";
        } 
        else {
            cout << "Charlie\n";
        }
    }
    return 0;
}






 

Comments