# 四种博弈浅谈（巴什博弈、威佐夫博弈、妮姆博奕、斐波那契博弈）

#include <stdio.h>
int main (){
int n,m;
while (scanf("%d%d",&n,&m)!=EOF){
if (n%(m+1))
printf ("first is winner\n");
else
printf ("second is winner\n");
}
return 0;
}

1、从一堆物品中取    至少取一个     没有上限

2、从两堆物品中取相同个数的物品

#include <stdio.h>
#include <math.h>
#include <algorithm>
using namespace std;
int main (){
int x,y;
while (scanf("%d%d",&x,&y)!=EOF){
if (x>y)
swap(x,y);
int tempx=(y-x)*(1+sqrt(5))/2;
if(tempx==x)
printf ("second is winner\n");
else
printf ("first is winner\n");
}
return 0;
}

#include <stdio.h>
int main (){
int num;
int n;
while (scanf("%d",&n)!=EOF){
int ans=0;
for (int i=0;i<n;i++){
scanf ("%d",&num);
ans^=num;
}
if (ans)
printf ("first is winner\n");
else
printf ("second is winner\n");
}
return 0;
}


#include <stdio.h>
typedef long long ll;
ll fib[50];
int main (){
int n;
fib[0]=1;
fib[1]=2;
for (int i=2;i<=50;i++)
fib[i]=fib[i-1]+fib[i-2];
while (scanf("%d",&n)!=EOF){
int flag=1;
for (int i=0;i<=50&&flag;i++)
if (fib[i]==n)
flag=0;
if (flag)
printf ("first is winner\n");
else
printf ("second is winner\n");
}
return 0;
}