forked from krnbatra/SPOJ-Solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathARMY.cpp
46 lines (40 loc) · 822 Bytes
/
ARMY.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
#include<bits/stdc++.h>
#include<string.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
#define ll long long
#define endl "\n"
int main()
{
fast;
int t,i;
cin >> t;
while(t--)
{
int ng, nm,max1=0,max2=0;
cin >> ng >> nm;
int arr1[ng], arr2[nm];
for(i=0;i<ng;i++)
{
cin >> arr1[i];
max1=max(arr1[i],max1);
}
for(i=0;i<nm;i++)
{
cin >> arr2[i];
max2=max(arr2[i],max2);
}
if(max1>max2)
{
cout << "Godzilla" << endl;
}
else if(max1<max2)
{
cout << "MechaGodzilla" << endl;
}
else if(max1==max2)
{
cout << "Godzilla" << endl;
}
}
}