Under construction

Still being built. Things may change

Partition of a Circle

Interview

Time limit1sMemory limit512 MB

Summary
A circle is cut by two straight lines, giving four regions with three known boundary lengths; find the fourth length opposite the third.
Level

Medium4 of 10

Topics
Geometry, Math, Implementation
Solved
No attempts yet

Problem

Mischievous Hyeokju has handled scissors very well since he was young. That is why he likes to cut colored paper with scissors however he pleases. Today Hyeokju received a circular piece of colored paper as a birthday present from a friend. Just as he was about to cut the paper, a friend said, "When you cut with scissors, cutting along an exact straight line makes it neater!" So Hyeokju decided to cut with scissors along exactly two straight lines. For example, Hyeokju cuts the paper as shown below. (After the first cut, he makes the second cut without moving the paper.)

Here, let pab be the length of the segment separating regions a and b, pbc the length of the segment separating b and c, and pcd the length of the segment separating c and d. Given the values of pab, pbc, and pcd, write a program that finds the length of the segment separating regions d and a.

Input

The first line gives the values of pab, pbc, and pcd in that order, separated by a single space each. All given values are positive integers no greater than 10,000.

Output

On the first line, print the length of the segment separating regions d and a. An absolute or relative error up to 10-6 is allowed.

Examples2

  1. Example 1

    Input
    5 5 5
    
    Expected output
    5
  2. Example 2

    Input
    9 8 13
    
    Expected output
    14.625