Prsteni
의견: 0
After an exhausting morning, Mirko fell asleep. His brother Stanko, however, just awoke and, like his brother, is all about excitement. Stanko found \(N\) rings of varying radii in the garage. He arranged them on the floor so that each ring (except the first and last) touches the ones before and after it.
He started turning the first ring and noticed that the other rings turned as well; some faster, some slower!
Thrilled with his discovery, he decided to count how many times the other rings turn while the first ring turns once. He gave up after noticing that this number is not always an integer and not knowing what to do.
Write a program that determines how many times each ring turns while the first turns once.
The first line of input contains an integer \(N\) (\(1 \le N \le 100\)), the number of rings.
The next line contains \(N\) integers between \(1\) and \(1000\), the radii of Stanko's rings, in the order they are laid out on the floor.
The output must contain \(N-1\) lines. For every ring other than the first, in the order they are given in the input, output a fraction \(A/B\), meaning that the respective ring turns \(A/B\) times while the first ring turns once. The fractions must be in reduced form (the numerator and denominator must not have a common divisor larger than \(1\)).
| 서브태스크 | 점수 | 설명 |
|---|---|---|
Subtask 1 | 30점 |
3
8 4 22/1
4/14
12 3 8 44/1
3/2
3/14
300 1 1 300300/1
300/1
1/1평가 및 의견
Prsteni
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Prsteni