#P9B. Running Student
Running Student
Running Student
题面翻译
题目描述
一位可怜的学生再次遭遇不幸——他要考试迟到了。
【他所在的地区可以看成一个平面直角坐标系,】他跑到了位于(0,0)处的公交车站,上了一辆小巴。这辆小巴沿x轴向x轴正方向行驶。
这个学生知道这样一些事:
这辆小巴将停靠n个站点,其中第i个站点位于(xi,0)处。
每一个站点的坐标都不相同。
这辆小巴将以速度vb匀速行驶。
小巴停站的时间很短,可以忽略不计。
乘客只能在站点上下车。
乘客最晚必须在终点站下车。
考试地点在(xu,yu)处。
他可以用vs的速度匀速从一个车站跑向考试地点。
在平面直角坐标系内,两点间的距离可以用 表示
他不能在上车站下车。 这个可怜的学生想用尽可能短的时间到达考试地点。请你帮他选择一个可以达到他的目的的下车地点。如果有多个满足的下车地点,请输出离考试地点最近的一个。
输入输出格式
输入格式
输入的第一行包括三个整数:n,vb和vs。第二行包括n个升序排序的非负整数,第i个数表示第i个站点的横坐标。第1个数一定等于0。第三行包括两个整数,依次为考试地点的横坐标xu和纵坐标yu。
输出格式
输出一行,一个整数,他应该下车站的序号。
说明
数据范围
保证$2 \leq n\leq100,1\leq vb,vs\leq 1000,0\leq xi\leq 10^5,0\leq |xu|,|yu|\leq 10^5$
其他
就像你所知道的一样,学生通常是匆匆忙忙的,但小巴通常不是。所以如果你发现学生的速度比小巴快,不要吃惊。
题目描述
And again a misfortune fell on Poor Student. He is being late for an exam.
Having rushed to a bus stop that is in point , he got on a minibus and they drove along a straight line, parallel to axis , in the direction of increasing .
Poor Student knows the following:
- during one run the minibus makes stops, the -th stop is in point
- coordinates of all the stops are different
- the minibus drives at a constant speed, equal to
- it can be assumed the passengers get on and off the minibus at a bus stop momentarily
- Student can get off the minibus only at a bus stop
- Student will have to get off the minibus at a terminal stop, if he does not get off earlier
- the University, where the exam will be held, is in point
- Student can run from a bus stop to the University at a constant speed as long as needed
- a distance between two points can be calculated according to the following formula:
- Student is already on the minibus, so, he cannot get off at the first bus stop
Poor Student wants to get to the University as soon as possible. Help him to choose the bus stop, where he should get off. If such bus stops are multiple, choose the bus stop closest to the University.
输入格式
The first line contains three integer numbers: , . The second line contains non-negative integers in ascending order: coordinates of the bus stop with index . It is guaranteed that equals to zero, and . The third line contains the coordinates of the University, integers and , not exceeding in absolute value.
输出格式
In the only line output the answer to the problem — index of the optimum bus stop.
样例 #1
样例输入 #1
4 5 2
0 2 4 6
4 1
样例输出 #1
3
样例 #2
样例输入 #2
2 1 1
0 100000
100000 100000
样例输出 #2
2
提示
As you know, students are a special sort of people, and minibuses usually do not hurry. That's why you should not be surprised, if Student's speed is higher than the speed of the minibus.