hdu2897 巴什博奕
n%(q+p)==0,也就是说先手必胜;
n%(q+p)<=p,先手必输;
n%(q+p)==k
if(k>p&&k<=q)先手必胜;
if(k>p&&k<(p+q))当然必胜;
#include<stdio.h> #include<string.h> int main() { int i,n,p,q; while(scanf("%d%d%d",&n,&p,&q)!=EOF) { if(n%(q+p)==0) printf("WIN\n"); else if(n%(q+p)<=p) printf("LOST\n"); else printf("WIN\n"); } }