My issue
Why does adding the “break;” result in WA?
My code
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t; cin>>t;
while (t--)
{
int x, y, k, n; cin>>x>>y>>k>>n;
//needs x-y pages
int xy = x-y;
bool can = false;
for (int i = 0; i < n; i++)
{
int p, c; cin>>p>>c;
if (p >= xy && c <= k)
{
can = true;
//break;
}
}
can ? cout << "LuckyChef" : cout << "UnluckyChef";
cout << endl;
}
return 0;
}
Problem Link: CNOTE Problem - CodeChef