-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJanuary_Long_2022_II_EXAMTIME.cpp
53 lines (51 loc) · 1.35 KB
/
January_Long_2022_II_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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// CodeChef January Long challenge 2022 II Division 3 (Rated)
// Problem Vivision 03
// 1* Coder in CodeChef Till 16/01/2022
// Problem Name: TCS Examination
// Problem Code: EXAMTIME
// Problem Link: https://www.codechef.com/JAN222C/problems/EXAMTIME
#include <iostream>
using namespace std;
int main() {
// your code goes here
int T;
cin>>T;
while(T--)
{
int Dragon_DSA,Dragon_TOC,Dragon_DM,Sloth_DSA,Sloth_TOC,Sloth_DM,Dragon,Sloth;
cin>>Dragon_DSA>>Dragon_TOC>>Dragon_DM;
cin>>Sloth_DSA>>Sloth_TOC>>Sloth_DM;
Dragon=Dragon_DSA+Dragon_TOC+Dragon_DM;
Sloth=Sloth_DSA+Sloth_TOC+Sloth_DM;
if(Dragon==Sloth)
{
if(Dragon_DSA==Sloth_DSA)
{
if(Dragon_TOC==Sloth_TOC)
{
std::cout << "TIE" << std::endl;
}else if(Dragon_TOC>Sloth_TOC)
{
std::cout << "DRAGON" << std::endl;
}
else
{
std::cout << "SLOTH" << std::endl;
}
}else if(Dragon_DSA>Sloth_DSA)
{
std::cout << "DRAGON" << std::endl;
}else
{
std::cout << "SLOTH" << std::endl;
}
}else if(Dragon>Sloth)
{
std::cout << "DRAGON" << std::endl;
}else
{
std::cout << "SLOTH" << std::endl;
}
}
return 0;
}