P6322 [COCI 2006/2007 #4] PRSTENI

Description

There are $n$ rings with different radii. Place them on the ground in a line in order, so that except for the first and the last ring, every other ring touches its two neighboring rings. When the first ring rotates by $1$ full turn, find how many turns each of the other rings rotates. Since the answer may not be an integer, output it as a simplest fraction. The format is shown in the sample.

Input Format

The first line contains an integer $n$, the number of rings. The second line contains $n$ integers, in order, representing the radius of each ring.

Output Format

Output a total of $n-1$ lines, representing the number of turns rotated by each ring except the first one.

Explanation/Hint

#### Constraints For $100\%$ of the testdata, it is guaranteed that $3 \le n \le 100$, and each radius is between $1$ and $1000$ (inclusive). #### Notes **This problem is translated from [COCI2006-2007](https://hsin.hr/coci/archive/2006_2007/) [CONTEST #4](https://hsin.hr/coci/archive/2006_2007/contest4_tasks.pdf) *T3 PRSTENI*** Translated by ChatGPT 5