You are a participant in a Quiz Competetion organized in Pantheon.You have 2 opponents from 2k10 batch Shikhar Atri
and Raghvesh Sharan and Trust me they are bloody Good.Throughout the game you and the other two competitors have gained some points.
Now at the end of the game the three of you are given a final question.Before you hear the question you have to wager some points.
If a contestant answers the question correctly he/she will be awarded the ponits equal to his wager and the same amount of points ( wager) will
be deducted in case of a wrong answer.The participant who ends up with highest score after the final question will end up winning the game.
Now it is time for you to place your wager.You can bet any amount between 0 and your current score , both inclusive.You are given your current score followed by the current scores of both your opponents and also their wagers.You have to place a wager which maximizes your probability
of winning the Quiz.You can assume that you and both the other participants each independently have a 50% chance to answer correctly.
If multiple wagers can give you the highest probabilty of winning , choose the minimum one.
Firts line contains number of test cases
Now each of the following T lines contains 5 integers on each line.
5 integers represnt your score followed by scores of your two opponents followed by wagers of your two opponents.
All scores and wagres <=100000
A single integer containing your minimum wager that maximizes you chances of winning.
100 100 100 25 75
10 50 60 30 41
Problem Setter: Arjun Singh Bhatia
Problem Tester: Shikhar Sharad