#include <iostream>
#include <stdbool.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--){
int x,y,k,n;
cin >> x >> y >> k >> n;
int left = x-y;
bool buy=false;
int page, prc;
for(int i=0;i<n;i++){
cin >> page >> prc;
if(page >= left && prc <= k ){
buy = true;
// break;
}
}
if(buy==true) cout << "LuckyChef\n";
else cout << "UnluckyChef\n";
}
return 0;
}
For the Problem CNOT(Chef and Notebooks), this code passes all the test but when I uncomment the break statement it gives wrong answer, but why?, please help on this.
Thank you