DMOPC '17 Contest 2 P0 - Secrets

View as PDF

Submit solution


Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Two secret agents are exchanging messages over a computer, however, they notice that there is a shady being nearby. Given the coordinates of the two secret agents (x_1, y_1) and (x_2, y_2), and the shady being, (x_s, y_s), is the shady being within D units of an agent?

Constraints

-100 \le x_1, y_1, x_2, y_2, x_s, y_s \le 100
1 \le D \le 100

Input Specification

The first line will consist of two space separated integers, x_1 and y_1.
The second line will consist of two space separated integers, x_2 and y_2.
The third line will consist of two space separated integers, x_s and y_s.
The fourth and final line of input will consist of a single integer, D

Output Specification

Yes, if the agent is within D units of either agent, and No otherwise.

Sample Input

1 10
2 3
3 3
10

Sample Output

Yes

Explanation for Sample Output

The distance between the second secret agent and the shady being is 1, which is less than or equal to 10. The distance between the first secret agent and the shady being is \sqrt{53}, which is also less than or equal to 10.


Comments

There are no comments at the moment.