A tussle year is considered to be lucky in BATU. No one knows what it is except you.
People in BATU want your help find when will the tussle year occur for their family. A tussle
year for a family is the one in which the age of the father is twice the age of his son. For
example, if the son’s age is 15, the father’s 30 and the grandfather’s age is 60 in a particular
year then it is a tussle year for the family.
Given the age of the 3 generations of a family, help people after how many years will the
tussle year occur for them. Print -1 if no tussle year occurs for their family.
In tussle year the age of the father is twice the age of his son.
from sys import stdin
for _ in range(int(stdin.readline())):
s, f, g = map(int, stdin.readline().strip().split())
using namespace std;
cin >> t;
int s, f, g;
cin >> s >> f >> g;
if(2*(f-s)!=(g-f) || (s>f || f>g))