aboutsummaryrefslogtreecommitdiff
path: root/Ghanophobia/main.cpp
blob: 31dff8813e60c26a58db28fc1fe1de1ab04c8e30 (plain)
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
#include<bits/stdc++.h>
#include <cstring>

using namespace std;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
  freopen("ghanophobia.in", "r", stdin);
	int tt;
	cin >> tt;
  int cnt = 0;
	while(tt--){
    cnt++;
    string s;
    cin >> s;
    string s1 = s.substr(0, s.find(":"));
    string s2 = s.substr(s.find(":") + 1, s.length() - 1);
    int eg = stoi(s1) + 1;
    int gh = stoi(s2) + 6;
    cout << "Case " << cnt << ": ";
    if (eg == gh){
      if (gh - 6 > 1) {
        cout << "NO\n";
      } else if (gh - 6 == 1) {
        cout << "PENALTIES\n";
      } else {
        cout << "YES\n";
      }
    } else if(eg > gh) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}