×

# CTKL - Editorial

Contest

Author: Md Shahid

Tester: Arkapravo Ghosh

Editorialist: Md Shahid

SIMPLE

Given h,d and u.

# EXPLANATION:

In this problem Jagga can only run away if he get a car. One of his friend is standing at the top of building of height 'h' having key of car which is near Jagga. Police is following Jagga and Jagga is running at the constant speed of 'u'.His friend standing at the top of building throw that key of car if Jagga can catch the key then he can start the car at time and run away If he fails to do so he will be caught by police.Here you have to find time to reach Jagga at the position where the key have been thrown and the time to reach the key from top of the building to ground.

Time taken to reach Jagga at position where the key has been thrown = Tg

Time taken to reach the key from top of the building to ground = Tk

Formula used :

1. S= V*t
2. S = Ut + (1/2)g*(t^2)

Where V= final velocity, U=initial velocity, X=distance covered in time 't', g=acceleration due to gravity.

Here initial velocity U is zero.

- Tg= (d/u) using formula 1.
- d= 0 + (1/2)*g*(Tk^2) i.e., Tk= (2*d/g)^0.5


if Tk >= Tg, print "Run away"

else, print "Caught"

# AUTHOR'S AND EDITORIALIST'S SOLUTIONS:

Author's and editorialist’s solution can be found here.

Tags:- ENCODING CTKL dshahid380

This question is marked "community wiki".

203
accept rate: 0%

19.5k348496535

 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×23