Here is my second code for [CNOTE Problem - CodeChef](https://This PRoblem)
its working on the test case but i guess it has some problem can someone help?
#include <bits/stdc++.h>
using namespace std;
/*
X page long poetry
Y pages in nb left
Shopkeeper shows N notebooks--> 'i' th is P pages and C rubles
But poeter has K rubles left
T cases
in each:
X Y K N
pages needed, Pages present, Money left, Notebooks seen
NEXT n lines--> P and C ie pages and rubles
LuckyChef,UnluckyChef
*/
int main(){
cin.tie(0);
cout.sync_with_stdio(false);
int t,x,y,k,n,p,c;
cin>>t;
for (int i = 0; i < t; ++i) // for cases
{ set<int> choice;
int frag = 0;
cin>>x>>y>>k>>n;
int page_in_need = x - y;
for (int j = 0; j < n ; ++j) // for notebooks seen
{
cin>>p>>c;
if (p>=page_in_need && c<=k){
// if price is less or eq to money
// if pages are satisf
frag=1;
break;}
// {
// choice.insert(1);
// }else
// {
// choice.insert(0);
// } }
// if (choice.count(1)){
// cout<<"LuckyChef"<<endl;
// }else{
// cout<<"UnluckyChef"<<endl;
// }
}
if (frag==1)
{
cout<<"LuckyChef"<<endl;
}else{
cout<<"UnluckyChef"<<endl;
}
}
}