UVa 10868

From Algorithmist
Jump to: navigation, search

10868 - Bungee Jumping[edit]

Summary[edit]

Physics problem.

Explanation[edit]

Let \Delta _{l} be the increase of rope length and v the speed when Bond reaches the ground, then by conservation of energy we have wgs=k\Delta l^{2}/2+wv^{2}/2, where g=9.81. Notice that \Delta l=0 if s<l, and s-l otherwise.

Gotchas[edit]

  • Take care of the case when s<l.

Input[edit]

350 20 30 75
375 20 30 75
400 20 30 75
425 20 30 75
450 20 30 75
400 20 30 50
400 20 30 80
400 20 30 85
100 20 1 80
0 0 0 0

Output[edit]

Killed 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.
James Bond survives.