#P15056. [UOI 2023 II Stage] Unenslaved puppy
[UOI 2023 II Stage] Unenslaved puppy
题目描述
A dog was attacked by angry bees. To hide from them, kind smurfs built domes.
Mathematically a dome is a semicircle with center at point and radius . It is impossible to pass through the wall of the dome. The dog and the beehive can be represented as two points and . If a point is inside the dome, we consider it to be inside.
Help the dog find out whether it is safe. That is, whether the bees can reach the dog without crossing the walls of domes.
:::align{center}
:::
输入格式
The first line contains five integers , , , , .
Each of the following lines contains two integers and .
输出格式
If the bees can reach the dog without crossing the walls of domes, print .
Otherwise, in the first line print , and in the second line print the smallest index (starting from one) of the dome that separates the bee and the dog.
3 2 1 2 2
2 1
3 2
3 1
NO
1
2 1 1 3 0
2 2
3 1
NO
2
2 2 1 4 1
3 2
3 1
YES
提示
Explanation for the first test:
:::align{center}
:::
Explanation for the second test:
:::align{center}
:::
Explanation for the third test:
:::align{center}
:::