Hangzhou Electric 1155 Bungee jumping (physics problem)

Source: Internet
Author: User

problem DescriptionOnce again, James Bond is fleeing from some evil people who want to see him dead. Fortunately, he has left a bungee rope in a nearby highway bridge which he can use to escape from his enemies. His plan was to attach one end of the rope to the bridge, the other end of the rope to his body and jump off the bridge. At the moment he reaches the ground, he'll cut the rope, jump to his car and be gone.

Unfortunately, he had not had enough time to calculate whether the bungee rope have the right length, so it's not clear at All of the going to happen when he jumps off the bridge. There is three possible scenarios:
The rope is too short (or too strong), and James Bond would never reach the ground.
The rope is too long (or too weak), and James Bond would be going too fast when he touches the ground. Even for a special agent, this can is very dangerous. Assume that if he collides at a speed of more than M/s, he'll not survive the impact.
The rope ' s length and strength are good. James Bond touches the ground at a comfortable speed and can escape.
As his employer, your would like to know whether James Bond survives or whether you should place a job ad for the Soon-to-b e vacant position in the local newspaper. Your physicists claim that:
The force with which James was pulled towards the earth is
9.81 * W,
where W is he weight in kilograms and 9.81 are the Earth acceleration in meters over squared seconds.
Mr Bond falls freely until the rope tautens. Then the force with which the bungee rope pulls him back into the sky depends on the current length of the rope and is
K *δl,
Whereδl is the difference between the rope's current length and its nominal, unexpanded length, and K are a rope-specific constant.
Given the rope ' s strength K, the nominal length of the rope L in meters, the height of the bridge s in meters, and James B Ond ' s body weight w, you has to determine what's going to happen to our hero. For all your calculations, you could assume that James Bond was a point at the end of the rope and the rope have no mass. Further assume that K, L, S, and W is non-negative and that s < 200.

The input contains several test cases, one test case per line. Each test case consists of four floating-point numbers (K, L, S, and W) that describe the situation. Depending on what's going to happen, your program must print "Stuck in the air.", "killed by the impact.", or "James Bond Survives. ". Input is terminated by a line containing four 0s, this line should isn't be processed.

Sample Input350 20 30 75375 20 30 75400 20 30 75425 20 30 75450 20 30 75400 20 30 50400 20 30 80400 20 30 850 0 0 0

Sample OutputKilled by the impact. James Bond survives. James Bond survives. James Bond survives. Stuck in the air. Stuck in the air. James Bond survives. Killed by the impact. physics problem, ask a person from the bridge with rope jumped three kinds of state, rope elastic, stiffness coefficient is k, if the person landing speed greater than 10 will fall dead. Ideas: first find out from the bridge to the ground gravitational potential energy eg, the speed of 10 of the kinetic EV, the rope to the ground (the rope may not be able to land, assuming to the Earth) of the elastic potential energy ek, first compare the length of the rope and the height of the bridge, if the rope grew up in the high bridge, judge eg and EV size; If the rope length is less than the height of the bridge, compare the size of eg and Ek, eg < EK indicates that the person will not fall, otherwise compare the size of Eg-ek and EV.
1 /*2 k rope stiffness coefficient3 L Rope Length4 the height of the S-Bridge5 W Weight6 */7#include <cstdio>8 #defineG 9.819 intMain ()Ten { One     Doublek,l,s,w; A     DoubleEg,ek,ev; -      while(SCANF ("%lf%lf%lf%lf", &k,&l,&s,&w) && (k+l+s+W)) -     { theeg=w*g*s; -ev= -*w/2; -ek=k* (s-l) * (s-l)/2; -         if(L >=s) +         { -             if(Eg <=Ev) +printf"James Bond survives.\n"); A             Else atprintf"killed by the impact.\n"); -         } -         Else -         { -             if(Eg <Ek) -printf"Stuck in the air.\n"); in             Else if(Eg-ek <=Ev) -printf"James Bond survives.\n"); to             Else +printf"killed by the impact.\n"); -         } the          *     } $     Panax Notoginseng}

Hangzhou Electric 1155 Bungee jumping (physics problem)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.