My issue
include
using namespace std;
int main() {
// your code goes here
int x,y,n,k,t;
bool flag;
//vector price;
cin>>t;
while(t–) {
cin>>x>>y>>k>>n;
int a,b;
flag = false;
for(int i=0; i< n; i++)
{
cin>>a>>b;
if((x-y) <= a && b <= k)
{
cout<<“LuckyChef\n”;
flag = true;
break;
}
}
if(!flag)
cout<<“UnluckyChef\n”;
}
return 0;
}
Bro wtf why is it wrong ???
My code
#include <iostream>
using namespace std;
int main() {
// your code goes here
int x,y,n,k,t;
bool flag;
//vector<int> price;
cin>>t;
while(t--) {
cin>>x>>y>>k>>n;
int a,b;
flag = false;
for(int i=0; i< n; i++)
{
cin>>a>>b;
if((x-y) <= a && b <= k)
{
cout<<"LuckyChef\n";
flag = true;
break;
}
}
if(!flag)
cout<<"UnluckyChef\n";
}
return 0;
}
Problem Link: CNOTE Problem - CodeChef