PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000040. Tỉ lệ vòng quay của các bánh răng (Rings)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Tỉ lệ vòng quay của các bánh răng (Rings)
Rings
Source: Kattis
Version: Phuoc Hung OJ Extended
Problem Statement
There are circular rings of radii . When the first ring completes one revolution, ring completes revolutions, assuming no slipping. For each , output this ratio as a reduced fraction p/q.
Input
The first line contains ; the second contains all .
Output
Print reduced fractions for in order.
Subtasks
- Subtask 1 (20 points): ;
- Subtask 2 (30 points): ;
- Subtask 3 (50 points): ;
Examples
Input
3
8 4 6
Output
2/1
4/3
Explanation
Ring two makes revolutions; ring three makes revolutions.