What's wrong in this code for CNOTE?

#include
#include <bits/stdc++.h>

#define fast  ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long

using namespace std;

int main() {
    fast;
    ll T;
    cin >> T;
    while (T--) {
        ll X, Y, N, K;
        cin >> X >> Y >> N >> K;
        bool found = false;
        for (ll i = 0; i < N; i++) {
            ll Pi, Ci;
            cin >> Pi >> Ci;
            if (Pi >= X - Y && Ci <= K)
                found = true;
        }
        cout << (found ? "LuckyChef" : "UnluckyChef") << '\n';
    }
    return 0;
}

you took the input in wrong format
cin>>X>>Y>>K>>N;
is the right way

2 Likes

Could you upvote it :slight_smile: