fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. cin.tie(NULL);
  6. cout.tie(NULL);
  7. ios_base::sync_with_stdio(false);
  8. long int t;
  9. cin>>t;
  10. while(t--)
  11. {
  12. long int x,y,n,k;
  13. cin>>x>>y>>n>>k;
  14. long int flag=0;
  15. long int pagesNeeded=x-y;
  16. for(int i=0;i<n;i++)
  17. {
  18. long int p,c;
  19. cin>>p>>c;
  20. if(p>=pagesNeeded && c<=k)
  21. flag=1;
  22. }
  23. if(flag==0)
  24. cout<<"UnluckyChef"<<endl;
  25. else
  26. cout<<"LuckyChef"<<endl;
  27.  
  28. }
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0s 4320KB
stdin
3
3 1 2 2
3 4
2 2    
3 1 2 2
2 3
2 3    
3 1 2 2
1 1
1 2
stdout
LuckyChef
UnluckyChef
UnluckyChef