题目原文的一个字都不要漏! t>=1 坑我半天
#include<cstdio>
int main()
{
long long a[30],b[30];
a[0]=1,a[1]=0;
b[0]=0,b[1]=1;
//printf("%lld %lld\n%lld %lld\n",a[0],b[0],a[1],b[1]);
for(int i=2;i<=30;i++)
{
a[i]=a[i-1]+a[i-2];
b[i]=b[i-1]+b[i-2];
//printf("%lld %lld\n",a[i],b[i]);
}
int t;
scanf("%d",&t);
while(t--)
{
long long i,j,m;
scanf("%lld%lld%lld",&i,&m,&j);
if((m-a[i])%b[i]!=0||(m-a[i])/b[i]<1) printf("-1\n"); //{ printf("(%d*(%d-%d))/%d\n",i,j,m,b[j],m,a[i],b[i]);}
else
{
printf("%lld\n",a[j]+((b[j]*(m-a[i])))/b[i]);
}
}
return 0;
}