数列整数相邻判断的问题,如何利用C语言的功能去实现的

Problem Description
You are working as a guide on a tour bus for retired people, and today you have taken your regular Nordic seniors to The Gate of Heavenly Peace. You let them have a lunch break where they could do whatever they like. Now you have to get them back to the bus, but they are all walking in random directions. You try to intersect them, and send them straight back to the bus. Minimize the time before the last person is in the bus. You will always be able to run faster than any of the tour guests, and they walk with constant speed, no matter what you tell them. The seniors walk in straight lines, and the only way of changing their direction is to give them promises of camphor candy. A senior will neither stop at nor enter the bus before given such a promise.

Input
A number of test cases consisting of: A line with an integer 1 ≤ n ≤ 8, the number of people on the tour. A line with an floating point number 1 < v ≤ 100, your maximum speed (you start in the bus at the origin). Then follow n lines, each containing four floating point numbers xi yi vi ai, the starting coordinates (-106 ≤ xi, yi ≤ 106), speed (1 ≤ vi < 100) and direction (0 ≤ ai < 2π) of each of the tour guests.

The input is terminated by a case with n = 0, which should not be processed. All floating point numbers in the input will be written in standard decimal notation, and have no more than 10 digits.

Output
For each test case, print a line with the time it takes before everybody is back in the bus (the origin). Round the answer to the nearest integer. The answer will never be larger than 106.

Sample Input
1
50.0
125.0 175.0 25.0 1.96
3
100.0
40.0 25.0 20.0 5.95
-185.0 195.0 6.0 2.35
30.0 -80.0 23.0 2.76
0

Sample Output
20
51

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!

相似问题

2
求数列的和,用C语言,谢谢
1
C语言求数列的的第n项的和
1
一个数列递推求解的问题,C语言数据结构怎么解决这个问题呢?
1
给一个整数x将该数插入到序列中,并使新的序列仍然有序,如何C语言
0
等差数列的问题,采用C 语言如何才能进行求解呢??
1
采用C语言解决这个问题,求区间数列的问题怎么实现?
3
1-D数列有序 问题C ACM
0
一个数列的递推的问题,怎么利用C语言和数据结构解决,最大值是K^2
2
求解一个和平方数列求和有关的解法的问题,采用C语言解决这个问题的思路实现怎么做?
0
数列递增序列,递减序列,数组实现,计算不同的颜色,使用的C语言谢谢
1
一个数列数组的求和再求比率的问题,如何利用C语言的方法编程算法解决
0
给一个整数x,请将该数插入到序列中,并使新的序列仍然有序,使用C语言怎么实现的计算
0
数列递推公式的实现,采用C语言的运用循环的方式,如何实现这个问题的解决?
0
数列级数的极值的计算的一个问题,请问是如何利用C语言的编程代码实现的呢
2
输入n(n<100)个数,将它与最前面的数交换后输出这些数。如何运用通过C语言的做法来解决这个问题的?
0
兔子繁殖的数列的问题,运用C语言的技术如何才能解决的?
0
综合运用C语言的编程的技术如何解决这里的数列求和的算法问题呢
0
数列对的问题,如何运用C语言的方式作答,利用C语言如何解决这个问题
0
请教各位神人看下这里的C语言如何才能高效解决楼梯数列推导的问题
0
这个数据结构问题运用数列递推的思路怎么使用C语言解决这个问题