You are not logged in. Please login at www.codechef.com to post your questions!

×

Can't Understand

Chef has been working in a restaurant which has N floors. He wants to minimize the time it takes him to go from the N-th floor to ground floor. He can either take the elevator or the stairs.

The stairs are at an angle of 45 degrees and Chef's velocity is V1 m/s when taking the stairs down. The elevator on the other hand moves with a velocity V2 m/s. Whenever an elevator is called, it always starts from ground floor and goes to N-th floor where it collects Chef (collecting takes no time), it then makes its way down to the ground floor with Chef in it.

The elevator cross a total distance equal to N meters when going from N-th floor to ground floor or vice versa, while the length of the stairs is sqrt(2) * N because the stairs is at angle 45 degrees. Chef has enlisted your help to decide whether he should use stairs or the elevator to minimize his travel time. Can you help him out? In this problem Why we use 2*N for Elevator distance ?

asked 21 Aug '17, 07:14

shashi_788's gravatar image

0★shashi_788
31
accept rate: 0%


Chef wants to come down to ground floor from n-th floor (e.g. 2nd, 3rd etc.). He has two options, either to take stairs or elevator. The velocity of chef is given v1 and that of elevator is v2. If he chooses elevator, the elevator is in the ground floor to so it first goes to nth floor picks up chef and comes back to ground floor. If he chooses stairs then stairs are at an angle of 45 degree so the distance by stairs is square root of 2 multiplied by n.

Now use simple distance-time-speed formula to calculate the minimum time.

link

answered 21 Aug '17, 07:28

adnanli's gravatar image

2★adnanli
241
accept rate: 33%

edited 21 Aug '17, 07:29

Answer is hidden as author is suspended. Click here to view.

answered 21 Aug '17, 09:48

raj79's gravatar image

1★raj79
(suspended)
accept rate: 10%

please upvote , i am new

link

answered 21 Aug '17, 09:58

aniket_coder's gravatar image

0★aniket_coder
153
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • 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:

×19

question asked: 21 Aug '17, 07:14

question was seen: 400 times

last updated: 21 Aug '17, 09:58