Created
September 16, 2017 13:38
-
-
Save hrsvrdhn/7e5f417f90a869bdcc5f05a9c5014903 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
#define all(a) a.begin(),a.end() | |
#define ll long long | |
#define inp(a) scanf("%d",&a) | |
#define out(a) printf("%d\n",a) | |
#define inp2(a) scanf("%lld",&a) | |
#define out2(a) printf("%lld\n",a) | |
#define arrinput(a,n) for(int i=0;i<n;i++) scanf("%d",&a[i]); | |
#define pii pair<int,int> | |
#define piii pair<int,pair<int,int> > | |
#define vi vector<int> | |
#define rep(i,start,n) for(int i=start;i<n;i++) | |
#define pb push_back | |
#define F first | |
#define S second | |
#define mp make_pair | |
#define vb vector<bool> | |
#define testcases() int test;scanf("%d",&test);while(test--) | |
#define priorityqueue priority_queue<int,vector<int>,greater<int> > | |
#define minheappop(a) pop_heap(a.begin(),a.end(),compare);a.pop_back(); | |
#define maxheappop(a) pop_heap(a.begin(),a.end());a.pop_back(); | |
#define minheappush(a,b) a.push_back(b);push_heap(a.begin(),a.end(),compare); | |
#define maxheappush(a,b) a.push_back(b);push_heap(a.begin(),a.end()); | |
const int mod=1000000007; | |
using namespace std; | |
int n,m,s[10009]; | |
bool game[10009]; | |
int main() | |
{ | |
testcases() | |
{ | |
inp(n);inp(m); | |
arrinput(s,m); | |
fill(game,game+n+1, false); | |
rep(i,1,n+1) | |
{ | |
rep(j,0,m) | |
{ | |
if(i<s[j]) | |
continue; | |
else if(game[i-s[j]] == false) | |
{ | |
game[i] = true; | |
break; | |
} | |
} | |
} | |
if (game[n]) | |
cout<<"Little Deepu\n"; | |
else | |
cout<<"Kate\n"; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment