1852. Ordered Fractions

单点时限: 2.0 sec

内存限制: 256 MB

Consider the set of all reduced fractions between 0 and 1 inclusive with denominators less than or equal to .

Here is the set when :

0/1 1/5 1/4 1/3 2/5 1/2 3/5 2/3 3/4 4/5 1/1

Write a program that, given an integer between and inclusive, prints the fractions in order of increasing magnitude.

输入格式

One line with a single integer .

输出格式

One fraction per line, sorted in order of magnitude.

样例

Input
5
Output
0/1
1/5
1/4
1/3
2/5
1/2
3/5
2/3
3/4
4/5
1/1

182 人解决,235 人已尝试。

265 份提交通过,共有 501 份提交。

2.4 EMB 奖励。

创建: 11 年,10 月前.

修改: 2 年,3 月前.

最后提交: 1 月,1 周前.

来源: USACO

题目标签