编程介的小学生 2020-08-18 08:18 采纳率: 20.5%
浏览 41
已结题

The Angry Birds 投掷的问题

Problem Description
“Lemme tell ya, these ain’t no ordinary finches we’re talkin’ about. These here are the Angry Birds, the ones that’s gonna kick you in the ‘nads. And they’re the ones on your side. They must be from Galapadapados, or sumptin’.” – Col. Angus, Bird Expert.
The survival of the Angry Birds is at stake. Dish out revenge on the green pigs who stole the Birds’ eggs. Use the unique destructive powers of the Angry Birds to lay waste to the pigs’ fortified castles.
There are 3 kinds of bird in Angry Birds Army -- the Red bird, the Yellow bird and the Blue bird. To destroy the pigs' fortified castles, birds will be shot by a sling. Different kind of birds has different flying routes after they are shot.
In this world, the acceleration of gravity is 9.8 m/(s^2);
1.The Red Bird:
The Red Bird's route is a normal parabola (抛物线) .

2.The Yellow Bird:
The Yellow Bird can accelerate. The Yellow Bird's flying route is the same as The Red Bird before it accelerate. After The Yellow Bird accelerate, both its horizontal velocity and its vertical velocity will be doubled at once(the bird is still affected by gravity after accelerating).

3.The Blue Bird:
The Blue Bird can split itself to 3 birds. The Blue Bird's flying route is the same as The Red Bird before it splits itself. After it splitting, The Blue Bird split itself to 3 birds with different horizontal velocities (but they have same vertical velocities).

As the Angry Bird Army's general, you must know the horizontal distance between the point(s) where the bird(s) touch the land and the sling.

Input
The input consists of multiple test cases.
Each test case has only one line which has 3 types according to different kind of birds.

H Red Vx Vy
H Yellow Vx Vy t
H Blue Vx Vy t V1 V2 V3

H the height of the sling.
Vx and Vy are the horizontal and vertical velocities when they are shot.
t is the time when the Yellow Bird accelerate or the Blue Bird splits after they are shot.
V1,V2,V3 are the horizontal velocities of the 3 birds split by the Blue Bird.

Notice: If the bird accelerate or split after the bird reach the land,nothing will happen;

0<=H,Vx,Vy,t,V1,V2,V3<=1000

Output
If the bird is the Red Bird or the Yellow Bird,please output the horizontal distance between the point(s) where the bird(s) touch the land and the sling.
If the bird is the Blue Bird,please output all the 3 birds's horizontal distance.
(If the bird accelerate or split after the bird reach the land,just output only one distance it reach the ground.)
The answer should be rounded after the third decimal place.

Sample Input
1 Red 1 2
2 Blue 3 4 1 1 2 3
2 Blue 3 4 10 1 2 3
5 Yellow 3 4 1

Sample Output
0.700
3.166 3.333 3.499
3.499
4.874

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 高价求中通快递查询接口
    • ¥15 解决一个加好友限制问题 或者有好的方案
    • ¥15 关于#java#的问题,请各位专家解答!
    • ¥15 急matlab编程仿真二阶震荡系统
    • ¥20 TEC-9的数据通路实验
    • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
    • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
    • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
    • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
    • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?