logo AlgoBeat OnlineJudge
登录 注册

#215197. [UOI 2023 II Stage] Unenslaved puppy

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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.

样例

样例输入 1

3 2 1 2 2
2 1
3 2
3 1

样例输出 1

NO
1

样例输入 2

2 1 1 3 0
2 2
3 1

样例输出 2

NO
2

样例输入 3

2 2 1 4 1
3 2
3 1

样例输出 3

YES

数据范围与提示

Explanation for the first test:

:::align{center} :::

Explanation for the second test:

:::align{center} :::

Explanation for the third test:

:::align{center} :::