Computer Science, asked by andeydhanu, 9 months ago


ONLINE EDITOR (C)
A
B
C
D
E
F
Jogging Ground
Problem Description
There are 4 circular grounds of equal sizes. Their circumferences do not intersect. The radius and the distance of the center of each circle from the leftmost circle's center are given.

There are 4 joggers who can start at the same time from any of the points designated as { a, b, c, d } on the circumference of all the four circles as shown in the diagram below. All 4 joggers jog in different grounds along the circumference of that ground. They could jog in either clockwise (left to right) or anticlockwise (right to left) direction. Finally they may also jog at different speeds.

Given starting position, direction of jogging and speed of jogging of all the 4 joggers, find the summation of length of 3 segments between the four joggers at a given point in time since the start of the jog.

com.tcs.cv.automata.ei.middleware.DocxToHtmlConverter@369beeb9:image1.png

Note: All the computation has to be accurate up to 6 digits after the decimal point.

Constraints
1 <= N < 10^9

Input
First line contains 4 integers each denoting the following

R denotes the radius of all four circles
D1 denotes the distance centre of the second circle from left to the centre of the leftmost circle
D2 denotes the distance centre of the third circle from left to the centre of the leftmost circle
D3 denotes the distance centre of the last circle from left to the centre of the leftmost circle
Second line contains 4 space separated integers denoting the angle with point a of each of the 4 circles where 0 degree indicates point a itself, 90 degree indicates point b, 180 degree indicates point c and 270 degree indicates point d.

Third line contains 4 space separated integers denoting the velocity in degrees per second.

Fourth line contains 4 space separated integers denoting the direction of running for joggers (0=clockwise and 1=anticlockwise).

Fifth Line contains integer N denoting the time in seconds since the start of the jog.

Output
Print the summation of length of 3 segments between the four joggers after N seconds, rounded to the nearest integer.

Time Limit
1

Answers

Answered by samyukthan568
2

Answer:

refer book

Explanation:

Similar questions