IPL Formula

5

1 votes
Easy
Problem

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,

  • Team with X units of Winning records in past Y matches will have

[(X+1)103Y]2X

chances to Win the Game, this is knows as Sub-Formula A

  • Team with P units of player having average of Q units and R units of strike-rate among total T units of players will have

[P(100Q)|QR|+(QR)T]2

chances to Win the game, this is known as Sub-Formula B

  • The final formula is shown below,

B0.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

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?