-
Notifications
You must be signed in to change notification settings - Fork 0
/
EXAMTIME.cpp
35 lines (34 loc) · 957 Bytes
/
EXAMTIME.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
using namespace std;
int main(){
int t,d[3],s[3];
int j=0;
cin>>t;
string ans[t];
for(int k=0;k<t;k++){
cin>>d[0]>>d[1]>>d[2];
cin>>s[0]>>s[1]>>s[2];
if((d[0]+d[1]+d[2])==(s[0]+s[1]+s[2])){
if(d[0]>s[0]){ans[j]="Dragon";}
else if(d[0]<s[0]){ans[j]="Sloth";}
else if(d[0]==s[0]){
if(d[1]>s[1]){ans[j]="Dragon";}
else if(d[1]<s[1]){ans[j]="Sloth";}
else if(d[1]==d[1]){
if(d[2]>s[2]){ans[j]="Dragon";}
else if(d[2]<s[2]){ans[j]="Sloth";}
else if(d[2]==d[2]){ans[j] ="Tie";}
}
}
}else{
if((d[0]+d[1]+d[2])>(s[0]+s[1]+s[2])){
ans[j] = "Dragon";
}else{ans[j]="Sloth";}
}
j++;
}
for(int i=0;i<t;i++){
cout<<ans[i]<<endl;
}
return 0;
}