hdu 2869 Paper Cutting Game 思维&&大水题&&博弈

Lily和Lucy正在玩一场新的纸张切割游戏,开始时有一张W*H的矩形纸张。Lily只能水平切割,Lucy只能垂直切割,每次切割必须将纸张均分为相同大小的矩形。玩家轮流操作,无法切割的人输。给定W和H,判断Lily是否能赢得游戏。如果Lily能找到大于1的最小因子,她就能赢。因为两人的切割互不影响,所以Lily只需关注自己的切割即可。这个问题可以通过模拟解决,数据范围较小,适合直接暴力求解。
摘要由CSDN通过智能技术生成

Lily and Lucy are playing a new paper cutting game. 
The game uses a rectangular paper that consists of W*H grids.At first,there is only a sheet of W*H paper. In each turn,One player picks up cut one piece of paper and cut it into several pieces of equal rectangular sections,and puts them back. Lily can only cut horizontally and Lucy can only cut vertically,keeping every grids unbroken.The one who can’t cut the paper loses. 
Now given you a sheet of W*H paper.We know Lily always plays first.We can assume that both player are clever enough to make the right move.Could you help Lily to make sure if she can win the game? 

Input

Input contains multiple cases. 
Each test case starts with two integerW(1<=N<=1000) ,H(1<=H<=1000) ,says that there is a sheet of W*H paper at firsst. 

Output

For each test case, if Lily can win the game output “Win”,otherwise output “Lose”.

Sample Input


                
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值