很水的博弈
n-1是必胜点 每k+1个一循环
#include "stdio.h"
#include "string.h"
#include "math.h"
#include "stdlib.h"
int main()
{
int n,find,k;
while (scanf("%d%d",&n,&k),n+k!=0)
{
if (n==1)
{
printf("Jiang\n");
continue;
}
n--;
find=0;
n%=(k+1);
if (n<=k && n!=0)
find=1;
if (find==1)
printf("Tang\n");
else
printf("Jiang\n");
}
return 0;
}