/** * @brief ラムダ式の再帰 * @author えびちゃん */ #ifndef H_make_fix_point #define H_make_fix_point #include template class fix_point: Fn { public: explicit constexpr fix_point(Fn&& f) noexcept: Fn(std::forward(f)) {} template constexpr decltype(auto) operator ()(Args&&... args) const { return Fn::operator ()(*this, std::forward(args)...); } }; template static inline constexpr decltype(auto) make_fix_point(Fn&& f) noexcept { return fix_point{std::forward(f)}; } #endif /* !defined(H_make_fix_point) */ #include #include int main() { int p; scanf("%d", &p); while (p--) { int n, k; scanf("%d %d", &n, &k); std::vector memo(n, 0); memo[0] = -1; int res = make_fix_point([&](auto dfs, int m) -> int { auto& res = memo[m]; if (res != 0) return res; res = -1; for (int i = 1; i <= k; ++i) { if (m-i < 0) break; if (dfs(m-i) == -1) { res = 1; break; } } return res; })(n-1); puts((res == 1)? "Win": "Lose"); } }