Problem
In a competition, there are three problems: . Alice challenges Bob that problem will be the most difficult, whereas Bob predicts that problem will be the most difficult.
You are given three integers , which represent the number of successful submissions of the problems . Each problem is guaranteed to have a varied amount of submissions. Decide who will win the challenge.
If Alice wins the challenge (that is, if problem is the most difficult), then output .
If Bob wins the challenge (that is, if problem is the most difficult), then output .
If no one wins the challenge (since problem is the most difficult), output .
Note: The problem with the fewest successful submissions is the most difficult.
Input Format
- The first line of input contains a single integer , which represents the number of test cases. The following is a description of test cases.
- Each test case's first and only line comprises three space-separated integers , which represent the number of successful submissions of problems , respectively.
Output Format
- For each test case, print the winner of the challenge or the word "Draw" if no one wins the challenge.
Constraints
- are all distinct.
Sample 1:
3 1 4 2 16 8 10 14 15 9
Draw Bob Alice
Explanation:
Test case : Because problem turns out to be the most difficult, no one wins the challenge.
Test case : Problem proves to be the most difficult, thus Bob wins the challenge.
Test case : Problem proves to be the most difficult, thus Alice wins the challenge.
Program :
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc=new Scanner (System.in);
int t=sc.nextInt();
while(t-->0)
{
int p=sc.nextInt();
int q=sc.nextInt();
int r=sc.nextInt();
if(p<q && p<r)
{
System.out.println("Draw");
}
if(q<p && q<r)
{
System.out.println("Bob");
}
if(r<p && r<q)
{
System.out.println("Alice");
}
}
}
}
0 Comments