forked from Mohammed-Shoaib/Coding-Problems
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathE0036.cpp
More file actions
31 lines (27 loc) · 647 Bytes
/
E0036.cpp
File metadata and controls
31 lines (27 loc) · 647 Bytes
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
// Problem Code: CNOTE
#include <iostream>
#include <vector>
#include <utility>
using namespace std;
string chefAndNotebooks(int X, int Y, int K, vector<pair<int, int>> ¬ebooks){
Y = X - Y;
for(pair<int, int> ¬ebook : notebooks)
if(notebook.first >= Y && notebook.second <= K)
return "LuckyChef";
return "UnluckyChef";
}
int main(){
int T, X, Y, K, N, P, C;
vector<pair<int, int>> notebooks;
cin >> T;
while(T--){
cin >> X >> Y >> K >> N;
for(int i=0 ; i<N ; i++){
cin >> P >> C;
notebooks.push_back(make_pair(P, C));
}
cout << chefAndNotebooks(X, Y, K, notebooks) << endl;
notebooks.clear();
}
return 0;
}