Snack Ruiner

1.8

12 votes
Medium
Problem

In India IPL is on full swing now. Fans of cricket love watching the game and seeing ball by ball with having Snacks. Yummy, crispy snacks. Ankit and his friends are one of them.

One night, while watching his Favourite team's Match he is eating Snacks. His team is leading the game and so his enjoyment growing ball by ball. Ankit and his friends found that healthier the Sanck they eat , their Team leads.

So on this concept they are eating alot of Snacks. Suddenly Ankit got that he ate up a bad Snack and his team lost a Wicket. Ankit went into so much of stress thinking that if he will have another bad Snack it will cost to his supporting Team.

So he decide to avoid eating bad Snacks. But he needs your help to achieve this. He will give you an integer N (Number of Snacks he brought) and the an array D of floating-point values telling that he thinks ith number of Snack can be faulted with a chances of D[i]. And an array F containing floating-point values denoting that chances if ith Snack is faulted then Overall Snack will be faulted by F[i].

Then your task is to answer him the indexing value you think that can have faulted Snack followed by a space with the probability of the Snack to be faulted.

Note that, Probability should have three decimal after floating-point.

Input : First line will contains an Integer T , number of Test Cases. Next T lines will have one integer N. The next two lines will contain N flaoting-point values , D[] and then F[]

Output : For each Test Case give the output in new line.

Constraints

1<= T <=25

3<= N <= 30

0.0<= D[i], F[i] < 1.0

Note :- To be Eligible for Prizes you have to register and create your home address maptag.

Important Update : The problem is based upon a concept of Probability. All candidates are requested to please go through the Problem Statement carefully once again.

Click here to create your Maptag

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

?