求第三个数字是不是类Fib数列中的一项
#include<iostream>
#include<cstdio>
#include<set>
#include<string>
#include<string.h>
#include<cstring>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<algorithm>
#include<sstream>
#include<utility>
#include<cmath>
#define mt(a) memset(a,0,sizeof (a))
#define fl(a,b,c) fill(a,b,c)
#define SWAP(a,b,t) (t=a,a=b,b=t)
#define inf 1000000
using namespace std;
typedef long long ll;
int main()
{
int T;
cin >> T;
while (T--)
{
ll x, y, z,t;
scanf("%lld %lld %lld", &x, &y,&z);
if (x == z || y == z){
puts("Yes"); continue;
}
while (1)
{
t = x + y;
if (t < z)
{
x = y;
y = t;
}
else if (t == z)
{
puts("Yes");
break;
}
else if (t>z)
{
puts("No");
break;
}
}
}
return 0;
}