Bidding CodeChef Solution

Problem – Bidding CodeChef Solution

Alice, Bob and Charlie are bidding for an artifact at an auction.
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 \leq T \leq 10001≤T≤1000
  • 1 \leq A, B, C \leq 10001≤A,B,C≤1000
  • AA, BB, 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

Explanation:

Test Case 1: Charlie wins the auction since he bid the highest amount.

Test Case 2: Bob wins the auction since he bid the highest amount.

Test Case 3: Alice wins the auction since she bid the highest amount.

Test Case 4: Alice wins the auction since she bid the highest amount.

Bidding CodeChef Solution in Python3

t=int(input())
for i in range(t):
    a,b,c=map(int,input().split())
    if a>b and a>c:
        print("Alice")
    elif b>c:
        print("Bob")
    else:
        print("Charlie")

Bidding CodeChef Solution in C++14

#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" << endl;
        else if (b > a && b > c)
            cout << "Bob" << endl;
        else
            cout << "Charlie " << endl;
    }
    return 0;
}

Bidding CodeChef Solution in Java


import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int inpVar = sc.nextInt();
		while(inpVar-->0)
		{
		    int Alice_bid = sc.nextInt();
		    int Bob_bid = sc.nextInt();
		    int Charlie_bid = sc.nextInt();
		    System.out.println(Alice_bid>Charlie_bid && Alice_bid>Bob_bid?"Alice":Bob_bid>Alice_bid && Bob_bid>Charlie_bid?"Bob":"Charlie");
		}
	}
}
Bidding CodeChef Solution Review:

In our experience, we suggest you solve this Bidding CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.

If you are stuck anywhere between any coding problem, just visit Queslers to get the Bidding CodeChef Solution

Find on CodeChef

Conclusion:

I hope this Bidding CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.

This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.

Keep Learning!

More Coding Solutions >>

LeetCode Solutions

Hacker Rank Solutions

CodeChef Solutions

Leave a Reply

Your email address will not be published.