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 "); else if(n%(q+p)<=p) printf("LOST "); else printf("WIN "); } }