#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define INF 100000007 #define INF_MAX 2147483647 #define LL_MAX 9223372036854775807 #define EPS 1e-10 #define PI acos(-1) #define LL long long using namespace std; #define MAX_N 120001 #define MAX_K 120001 int N, K; int memo[MAX_N][2]; //memo[i][j]: jにiの数が回ってきた時にjが勝てるか int solve(int pos, int turn){ if(memo[pos][turn] != 0){ return memo[pos][turn]; } if(pos == N){ return memo[pos][turn] = 1; } bool flag = false; int nextTurn = (turn + 1) % 2; for(int i = 1; i <= K; i++){ int nextP = pos + i; if(nextP > N) break; if(solve(nextP, nextTurn) == -1){ flag = true; } } if(flag){ return memo[pos][turn] = 1; } else{ return memo[pos][turn] = -1; } } int main(){ int P; cin >> P; for(int i = 0; i < P; i++){ memset(memo, 0, sizeof(memo)); cin >> N >> K; if(solve(0, 0) == 1){ cout << "Win" << endl; } else{ cout << "Lose" << endl; } } return 0; }