fun main(args: Array){ val gameCount = readLine()!!.toInt() for (i in 1..gameCount) { val (n,k) = readLine()!!.split(" ").map { it.toInt() } canWin(n,k) } } fun canWin(n:Int, k:Int) { dic.clear() val ans = if (canWinSub(0, n, k)) "Win" else "Lose" println(ans) } val dic = mutableMapOf() fun canWinSub(num:Int, n:Int, k:Int):Boolean { if(num+1>=n) { return false } dic[num]?.let { return it } var canWin = false for(i in 1..k) { if(i+num >= n) { break } if(!canWinSub(num+i, n, k)) { canWin = true break } } dic[num] = canWin return canWin }