Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool solve(int needed, int n, int money)
- {
- bool solveable=false;
- while(n--)
- {
- int pi,ci;
- cin>>pi>>ci;
- if(pi>=needed && money>=ci)
- solveable=true;
- }
- return solveable;
- }
- int main()
- {
- int t;
- cin>>t;
- while(t--)
- {
- int x,y,k,n;
- cin>>x>>y>>k>>n;
- if(solve(x-y,n,k))
- cout<<"LuckyChef"<<endl;
- else
- cout<<"UnluckyChef"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement