Type: RemoteJudge 1000ms 125MiB

[USACO2.1] Ordered Fractions

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

Consider the set of all reduced fractions between 00 and 11 inclusive with denominators less than or equal to NN.

Here is the set when N=5N = 5:

$$\frac01,\frac15,\frac14,\frac13,\frac25,\frac12,\frac35,\frac23,\frac34 ,\frac45,\frac11$$

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

输入格式

One line with a single integer NN.

输出格式

One fraction per line, sorted in order of magnitude.

5

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

提示

USACO Training Section 2.1.

入门作业2

Not Claimed
Status
Done
Problem
18
Open Since
2026-2-5 0:00
Deadline
2026-2-25 0:00
Extension
24 hour(s)