## Mock CCC '19 Contest 2 S2 - Tudor Puts A Goat On A Rope

View as PDF

Points: 4 (partial)
Time limit: 1.0s
Memory limit: 1G

Problem type

Tudor is going on vacation!

While Tudor is on vacation, he decides to take his goat and tie to a fence post with a rope. Because he doesn't want to infringe too many on the goat's freedom to trample on the earth, he wants the rope to be as long as possible. However, because he doesn't feel like dealing with property damage, he doesn't want the goat to be able to run into his house.

Tudor's house is modeled as an axis-aligned rectangle with corners at and , and the fence post is at .

Compute the length of the longest rope such that the goat cannot reach Tudor's house.

#### Constraints

will not fall inside the axis-aligned rectangle with corners at and .

There are no explicit subtasks for this problem. There will be 15 secret test cases, each worth one mark.

#### Input Specification

The input will consist of six space-separated integers, , , , , , .

#### Output Specification

Output, on a single line, the maximum length of rope Tudor can use. This number must be rounded to three decimal places.

#### Sample Input

7 4 0 0 5 4

#### Sample Output

2.000

#### Sample Input

6 0 0 2 7 6

#### Sample Output

2.000

#### Sample Input

4 8 7 8 9 9

#### Sample Output

3.000