# Challenge for Most Difficult Problem : CHMDFP032

### Challenge for Most Difficult Problem CodeChef solution in C, C++, JAVA, Python

In a competition, there are three 33 problems: P,Q,RP,Q,R. Alice challenges Bob that problem RR will be the most difficult, whereas Bob predicts that problem QQ will be the most difficult.

You are given three integers SP,SQ,SRSP,SQ,SR, which represent the number of successful submissions of the problems P,Q,RP,Q,R. Each problem is guaranteed to have a varied amount of submissions. Decide who will win the challenge.

1) If Alice wins the challenge (that is, if problem RR is the most difficult), then output AliceAlice.

2) If Bob wins the challenge (that is, if problem QQ is the most difficult), then output BobBob.

3) If no one wins the challenge (since problem PP is the most difficult), output DrawDraw.

Note: The problem with the fewest successful submissions is the most difficult.

### Input Format

• The first line of input contains a single integer TT, which represents the number of test cases. The following is a description of TT test cases.
• Each test case’s first and only line comprises three space-separated integers SP,SQ,SRSP,SQ,SR, which represent the number of successful submissions of problems P,Q,RP,Q,R, respectively.

### Output Format

• For each test case, print the winner of the challenge or the word “Draw” if no one wins the challenge.

### Constraints

• 1≤T≤1001≤T≤100
• 1≤SP,SQ,SR≤1001≤SP,SQ,SR≤100
• SP,SQ,SRSP,SQ,SR are all distinct.

### Sample Input 1

``````3
1 4 2
16 8 10
14 15 9
``````

### Sample Output 1

``````Draw
Bob
Alice
``````

### Explanation

Test case 11: Because problem PP turns out to be the most difficult, no one wins the challenge.

Test case 22: Problem QQ proves to be the most difficult, thus Bob wins the challenge.

Test case 33: Problem RR proves to be the most difficult, thus Alice wins the challenge.

## Challenge for Most Difficult Problem CodeChef solution in C

``````int main()
{

int t;
scanf("%d",&t);
while(t--)
{

int p,q,r;
scanf("%d %d %d",&p,&q,&r);
if(p < q && p < r)
{
printf("Draw\n");
}
else if(q < r)
{
printf("Bob\n");
}
else
{
printf("Alice\n");
}
}
return 0;
}``````

## Challenge for Most Difficult Problem CodeChef solution in C++ 14

``````
int main() {

int t;
cin>>t;
while(t--) {
int p,q,r;
cin >>p>>q>>r;
if (p < q && p < r) {
cout << "Draw" << endl;
} else if (q < p && q < r)  {
cout << "Bob" << endl;
} else {
cout << "Alice"<< endl;

}
}

return 0;
}``````

## Challenge for Most Difficult Problem CodeChef solution in Python 3

``soon ``

## Challenge for Most Difficult Problem CodeChef solution in Java

``````/* 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
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0)
{
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
if(a <=b && a <=c)
System.out.println("Draw");
else if (b <= a && b <=c)
System.out.println("Bob");
else
System.out.println("Alice");
}
}
}``````
{"ft_lang_label":"__label__en","ft_lang_prob":0.6935713,"math_prob":0.91939616,"size":3249,"snap":"2023-40-2023-50","text_gpt3_token_len":874,"char_repetition_ratio":0.1494607,"word_repetition_ratio":0.14656772,"special_character_ratio":0.29024315,"punctuation_ratio":0.18233618,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99489975,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-05T14:57:49Z\",\"WARC-Record-ID\":\"<urn:uuid:6f98c2ea-996d-4b13-99e7-27ac3cbcfb4a>\",\"Content-Length\":\"69904\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:25beff9c-4857-41ff-b68c-18b3afd96d08>\",\"WARC-Concurrent-To\":\"<urn:uuid:adbc3105-b064-4aa0-93a9-1ce2b8cd6fb0>\",\"WARC-IP-Address\":\"13.127.136.180\",\"WARC-Target-URI\":\"https://progiez.com/challenge-for-most-difficult-problem-codechef-solution\",\"WARC-Payload-Digest\":\"sha1:3PNPXQPCKWUYUP2M255GLQBUNODIISUL\",\"WARC-Block-Digest\":\"sha1:7D6BAOMM2K7UYULS4HQMAQQTM7C5KGQF\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100551.2_warc_CC-MAIN-20231205140836-20231205170836-00546.warc.gz\"}"}