#include using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;iP; ll x[3]; int main(){ int t; cin>>t; rep(i,t){ ll a,b,c; cin>>a>>b>>c; x[0]=a; x[1]=b; x[2]=c; while(1){ if(a+b>c && a+c>b && ab && b>c){ c+=x[2]; continue; } if(a