問題一覧 > 通常問題

No.542 1-Yen Coins and 5-Yen Coins

レベル : / AI推定難易度 : 133 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 505
作問者 : nmnmnmnmnmnmnm / テスター : はむこ
お気に入りにしたユーザー ProblemId : 1677 / 自分の提出
問題文最終更新日: 2026-06-26 06:07:43
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 169 (順位表) の他の問題:

Problem Statement

There are $A$ 1-yen coins and $B$ 5-yen coins.
List all the amounts that can be made, in ascending order.

Input

$A$ $B$

$A$ is the number of 1-yen coins. $A$ is a non-negative integer. $0 \le A \le 100$.
$B$ is the number of 5-yen coins. $B$ is a non-negative integer. $0 \le B \le 100$.
$A$ and $B$ are never both $0$.

Output

If there are $N$ possible amounts, output the answer on $N$ lines from top to bottom, in ascending order of amount.
Note that $0$ yen is not included in the answer.
Print a newline at the end of each line.

Sample

Sample 1
Input
2 1
Output
1
2
5
6
7

There are 2 1-yen coins and 1 5-yen coin.
The amounts that can be made are, in ascending order, 1 yen, 2 yen, 5 yen, 6 yen, and 7 yen.

Sample 2
Input
0 3
Output
5
10
15

There are no 1-yen coins.
Using only 5-yen coins, 5 yen, 10 yen, and 15 yen can be made.

Sample 3
Input
6 1
Output
1
2
3
4
5
6
7
8
9
10
11

All amounts from 1 yen to 11 yen can be made.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。