As IPL 2017 is in full swing and points table is getting in with big changes. Being a viewer we love to enjoy the game. And there exist a category of people who wants to make Money from it.
RsamJ is one of them, he had a very bad time till now in this season. And after doing some research and calculation he made a formula which approximately tells that which team will Win the game.
The Formula is as follows,
[(X+1)∗10−3∗Y]2X
chances to Win the Game, this is knows as Sub-Formula A
[P∗(100∗Q)|Q−R|+(Q∗R)T]−2
chances to Win the game, this is known as Sub-Formula B
B∗0.01A
You will be given values of X,Y,P,Q,R,T .
Your task is to find out the approximation of which team will Win the next N matches. (if both teams manage to play against each-other for next N matches)
Inputs
First line of input will contain T test cases. Next T lines will tell you X1 X2 Y1 Y2 P1 P2 Q1 Q2 R1 R2 T1 T2 N
Here X1,Y1,P1,Q1,R1,T1 belongs to First team and X2,Y2,P2,Q2,R2,T2 belongs to Second Team
Output
For each test case, print the result of next N matches in single line separated by single space , denoting teams 1 for First Team and 2 for Second Team
Constraints
1<= T <= 100
1<= X1,Y1,P1,R1,Q1,T1
1<= X2,Y2,P2,R2,Q2,T2
1<= N