Help me in solving CNOTE problem

My issue,what is wrong in this code

My code

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin >> t;
	int r =0;
	
	while(t--){
	    int x,y,k,n;
	    cin >> x >> y >> k >> n;
	     pair<int,int> p_arr[n];
	   for(int i=0;i<n;i++){
	       int p,c;
	       cin >> p >> c;
	      p_arr[i] = {p,c};
	   }
	   for(int i=0;i<n;i++){
	       int remaining_page = x-y;
	       int a=0,b=0;
	       a=p_arr[i].first;
	       b=p_arr[i].second;
	       if(remaining_page==a && k>=b)
	      {
	          r++;
	      }
	   }
	   if(r>=1){
	        cout << "LuckyChef";
	   }
	       else{
	       cout << "UnluckyChef";
	   }
	   r=0;
	   
	    
	}
	return 0;
}




Problem Link: CNOTE Problem - CodeChef