Rain on your Fat brother, C语言

Problem Description
After retired form the ACM/ICPC competition, Fat brother starts his civil servant’s life with his pretty girl friend Maze. As far as we known for this holy job, we can imagine how a decadent life they are dealing with!

But one day, Fat brother and Maze have a big quarrel because of some petty things and Maze just run away straight from him. It’s raining cats and dogs outside, our hero Fat brother feel very worried about the little princess so he decide to chase her. As Maze is a tsundere girl, she would feel angry when she touches the rain until she meets the Fat brother.

To simplify this problem, we can just consider each person as a point running along the X coordinate from right to left and the rain as a combination of an isosceles triangle and a half round. The speed of Maze is v1 unit per second and the speed of Fat brother is v2 unit per second (v1 < v2). The place where they have a quarrel is (x, 0) and Fat brother start to chase Maze after T second. You can assume that the rain is doing the uniform linear motion (drop with the same speed forever). Your task is calculating how long (time) the Maze is in the rain. The Maze is considered in the rain even if the point representing her is just touch the border. See the picture for more detail.

Input
The first line contains only one integer T (T<=200), which is the number of test cases. For each test case, first line comes five positive integer v1, v2, v, t, x (v1<v2). v1 is the speed of Maze, v2 is the speed of Fat brother, v is the speed of the rain, you can assume that all rain is in a same speed, t means Fat brother starts to chase Maze after t second, x means they have a quarrel in (x, 0). Then a line with an integer n means that there is n rain begin to drop when Maze start running, 1<=n<=1000. Then n lines describe the rain. Each line contains four integers x0, y0, r, h. (x0, y0) is the center of the circle, r is the radius of the circle, h is the height of the triangle. All the number mentioned before except x0 are positive and no large than 1000. x0 is no large than 1000 and no less than -1000. Note that the point (x, 0) may in the rain in the beginning. Two rains may intersect with each other. See the picture for more detail.

Output
For each test case, output the case number first, then output how long (time) Maze is in the rain, round to 4 digits after decimal point.

Sample Input
4
1 2 1 100 1
1
1 1 1 1
1 2 1 100 1
1
2 1 1 1
1 2 1 100 1
1
-9 9 10 10
2 3 1 100 1
1
-9 9 10 10

Sample Output
Case 1: 1.0000
Case 2: 0.0000
Case 3: 12.0534
Case 4: 8.0428

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

相似问题

2
一个有关天气预报的算法C语言问题
1
计算输出正确的年份的起始截至,中间用空格分隔,是C语言
0
一个有关天气和降水量的预报方面的问题,比较模糊,如何采用C语言的实现的方式?
0
用C语言实现一个天气的统计和预报的功能,判断是否成立
0
综合运用C语言的编程的技术如何解决这里的数列求和的算法问题呢
0
一个天气遇到的计算的运算的算法,怎么利用C语言的程序的设计的方式实现的
0
先取模再求和的一个算法的计算问题,怎么利用C程序的语言代码编写的方式实现呢?
1
日期和天气的问题的计算,运用C程序的代码编写过程的思路和方式什么办法实现?
0
根据年份计算是否下雨的概率问题,是如何利用C语言的程序编写程序的代码设计思想的方法计算的
0
分段路径求和的计算问题的数据结构怎么用C语言的程序设计思想编写出来的程序代码来实现的
0
根据规则计算天气的气象问题,怎么使用C程序的语言的代码的编写的过程用什么思路去实现解决的
0
最大的汽缸的可能的容量的计算问题,怎么使用C语言的程序的编写的过程的方式的技术来实现
0
输出二维平面凸多边形的问题,使用C程序的代码设计的方式和步骤来计算的实现的思路
0
特定降雨期间降雨量有多少根据给定的假设,怎么使用C语言的程序的编写的过程的代码有效地加以实现的
0
请教如何使用C语言来解决一个天气的预测的问题的
0
降雨量的一个计算的问题,怎么采用C语言的计算实现的
0
WorstWeather Ever
0
Rain on your Parade
0
Rain on your Fat brother
0
Dark Parth代码的编写的思路