Ուղարկել | Բոլոր լուծումները | Լավագույն լուծումները | Վերադառնալ ցուցակին |
ACM_0243 - BELT DRIVE |
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 engi- neers 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; 2π(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
№ |
stdin |
stdout |
1 |
1.0 2.0 20.0 |
5.191 |
2 |
1.0 2.0 18.85 |
4.6036 |
Ավելացրեց. | Հրանտ Հովհաննիսյան |
Ամսաթիվ. | 2014-10-08 |
Ժամանակի սահմանափակումը. | 1s |
Ծրագրի տեքստի սահմանափակումը. | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Լեզուներ. | Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PYPY3 PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE |
Աղբյուրը. | Central QF 2014.I |