305533: CF1046I. Say Hello
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Say Hello
题意翻译
## **题目描述** 两个朋友正在芭比星系旅行。他们说“你好啊!”如果距离小于或等于d1且 ·这是他们第一次交谈,或者 ·在他们上次谈话后的某个时间点,他们的距离大于d2。 我们需要计算朋友们说“你好”的次数。彼此之间。对于n个时刻,您将为每个朋友提供一组点,代表他们在那一时刻的位置。一个人可以在两个时刻之间保持相同的位置,但是如果一个人移动了,我们假设这个移动是以恒定的速度在恒定的方向上移动。 ## 输入输出格式 输出包含一个整数,表示朋友彼此之间会说“你好啊!”的次数。题目描述
Two friends are travelling through Bubble galaxy. They say "Hello!" via signals to each other if their distance is smaller or equal than $ d_1 $ and - it's the first time they speak to each other or - at some point in time after their last talk their distance was greater than $ d_2 $ . We need to calculate how many times friends said "Hello!" to each other. For $ N $ moments, you'll have an array of points for each friend representing their positions at that moment. A person can stay in the same position between two moments in time, but if a person made a move we assume this movement as movement with constant speed in constant direction.输入输出格式
输入格式
The first line contains one integer number $ N $ ( $ 2 \leq N \leq 100\,000 $ ) representing number of moments in which we captured positions for two friends. The second line contains two integer numbers $ d_1 $ and $ d_2 \ (0 < d_1 < d_2 < 1000) $ . The next $ N $ lines contains four integer numbers $ A_x,A_y,B_x,B_y $ ( $ 0 \leq A_x, A_y, B_x, B_y \leq 1000 $ ) representing coordinates of friends A and B in each captured moment.
输出格式
Output contains one integer number that represents how many times friends will say "Hello!" to each other.
输入输出样例
输入样例 #1
4
2 5
0 0 0 10
5 5 5 6
5 0 10 5
14 7 10 5
输出样例 #1
2