Question
Little Brady is in a hurry to go play cricket with his mates.In the hurry, he forgot to fill his water bottle. Fortunately, there is
Little Brady is in a hurry to go play cricket with his mates.In the hurry, he forgot to fill his water bottle. Fortunately, there is a river flowing nearby from which he can fill in his bottle.
Perpendicular distances of Brady's current location (L) and the cricket ground (C) from the flowing river are dL and dC units respectively. Perpendicular distance of the lines from Brady's current location to the river and cricket ground to the river is dR. Find the minimum distance Brady will have to cover for reaching the river bank from Brady's house with an empty bottle, and then reaching the cricket ground with bottle filled with water.
Hint: Use fixed and setprecision(6) in CPP or %.6f in C and double data type to make sure your solution gives answer correct upto 5 decimal places
Input Format
The first line consists of a t test cases
Each instance of the problem is a single line with three positive numbers dL, dC, and dR, each less than 100000, given in a single line.
Constraints
t <= 100000 0 <= dL,dC,dR <= 10000
Your answer should be a decimal number with error less than 0.00001
Output Format
The answer of each test case in a seperate lines
Sample Input 0
2
10000 10000 10000
10 12 15
Sample Output 0
22360.679775
26.627054
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started