Logo
(追記) (追記ここまで)

27108번 - Ordered Fractions 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB1461158983.962%

문제

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

Here is the proper set when N = 5:

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 N between 1 and 500 inclusive, prints the total number of fractions, orders them, and prints a few of them to prove that your program can order them correctly.

입력

The only line contains one integer, N.

출력

On the first line of the output, print the total number of fractions per the rules above. Subsequent lines should print every fraction from the ordered list, starting with the first fraction.

제한

예제 입력 1

5

예제 출력 1

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

힌트

출처

Olympiad > USA Computing Olympiad > 1999-2000 Season > USACO Fall 1999 Contest > Gold 3번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /