ÀÂÒ
Language: Russian
English

Remote Training on Programming

Problems Online status Contests
News FAQ E-learning
For authors:
Register  ||  Login
 
Hello, Guest! Please login or register.

1333. Belt Drive

Time Limit: 1 seconds
Memory Limit:65536KB
Points:100
View Problem Statistics Submit Problem added debug

A belt drive consists of two pulleys of different radius (r1 and r2) connected by a belt of length l. The industry manufactures belts of different standard lengths, so the engineers often face a task of calculating the distance between the pulley centers given their radii and the belt length. There are several simple approximate methods to do this, which are precise enough for rough estimations. However, some engineering tasks require more precise data.

Your task is to write a program that will calculate the distance a between the centers of the pulleys given their radii r1 and r2, and the length l of the belt.

Limitations

1 £ r1, r2 £ 1,000; 2p(r1 + r2) £ l £ 10,000.

Input

The first line contains 3 space-delimited real numbers precise to four decimal places: r1, r2, l. Trailing zeros following the decimal point may be omitted.

Output

The output file should contain a single real number, the center-to-center distance a. The answer must be precise to four decimal places.

Example

Input

Output

1.0 2.0 20.0

5.191

1.0 2.0 18.85

4.6036

 

 


View Problem Statistics Submit Problem discussion Author/source:
Problems from Contests and Camps / World Championship in Programming (ICPC) / Rybinsk-2014 /
1332. H - Cryptography 1333. 1334. J - Dominoes 1335. K - Embroidery
time generating 0.344 sec.
© Copyright VSU, AVT, Nosov D.A., Andrianov I.A.