Type: Default 1000ms 256MiB

Land Overseer

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Background

The role of Keqing, Yuheng of the Liyue Qixing, is to manage real estate and construction in Liyue.

Today Keqing decides to leave her office, and visit two places - Chasm, and Jueyun Karst - to make sure the building progress there is at a reasonable pace.

The location of Keqing's office and the two places to visit can be denoted as three points on a 2D Cartesian coordinate system.

Keqing's office, the start point, is Located at Point O (0,0).

Chasm is located at Point A (a,b).

Jueyun Karst is located at Point B (2a,0).

Keqing plans to visit Chasm first and then go to Jueyun Karst. Because Keqing is an experienced land overseer, she does not need to be at the exact location to do her job. She can finish the visit if the distance between her and the target point is no greater than R.

Please help Keqing find the shortest path to visiting Chasm and Jueyun Karst.

Description

Given two integers x and y, print the sum.

Input

There are T test cases in this problem.

The first line has one integer T.

In the following T lines, each contains three integers a,b,R.

We guarantee that 0<a,b,R<1e90<a,b,R<1e9, a2+b2>4R2a^2+b^2>4R^2, and T1000T\leq 1000.

Output

Then in one line, print a number L, the length of the shortest path to

finish the visiting, rounded to two decimal places.

Samples

1

3 5 1
9.00

Limitation

1s, 1024KiB for each test case.

第三届SWPUACM新生赛-正式赛

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
12
Start at
2021-10-24 13:00
End at
2021-10-24 18:00
Duration
5 hour(s)
Host
Partic.
65