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

×

Meeting Of 2 People On a circular track

Two persons are running on a circular track either in the same direction or in the opposite direction, indefinitely.

The speed of both of them is given to you.

Speed will be positive in clockwise direction, and negative in anticlockwise direction.

Calculate the number of distinct points, at which they will meet on the circle

For example, if the speed are 1, 2 then the number of distinct points are 1 and if the speeds are 1, ?1, then number of distinct points are 2.

Assume the speeds to be x and y. I need a general solution.

asked 17 Jun '12, 03:42

ashhar24's gravatar image

4★ashhar24
26459
accept rate: 0%


link

answered 17 Jun '12, 21:24

javadecoder's gravatar image

4★javadecoder
6271713
accept rate: 27%

-2

first let us assume that both x and y are positive.

let both of them start from the same point. they again meet after the slower one (let x be the slower one) has travelled an angle ?. the faster y has travelled ? + 2pi. ?/x = (? + 360)/y solve for ?. now take multiples of ? and check if they are divisible by 360. The smallest k such that ?*k % 360 == 0 will be the number of times they meet. eg. if ? comes out to be 60. they meet 6 times. note that there will be infinite meeting spots if x/y is irrational :-)

link

answered 17 Jun '12, 19:49

pyronic's gravatar image

2★pyronic
9111
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:

×15

question asked: 17 Jun '12, 03:42

question was seen: 4,723 times

last updated: 17 Jun '12, 21:24