No.207 The World's Something-or-Other
問題文最終更新日: 2026-06-25 13:55:10
English (AI translation)
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 104
(順位表)
の他の問題:
Problem Statement
Among the integers between \(A\) and \(B\), inclusive, output the multiples of 3 and the numbers containing a 3, in ascending order.
Here, a "number containing a 3" is a number that has at least one digit equal to 3 when written in decimal notation.
Input
A B
All inputs are given as integers.
\(1 \leq A \leq 2000000000\)
\(1 \leq B \leq 2000000000\)
\(0 \leq B - A \lt 100\)
Output
Output the applicable numbers in ascending order.
Print a newline after each number you output.
If there are no applicable numbers, output nothing.
Sample
Sample 1
Input
1 10
Output
3 6 9
3, 6, 9 are multiples of 3.
Sample 2
Input
10 20
Output
12 13 15 18
12, 15, 18 are multiples of 3, and 13 is a number containing a 3.
Sample 3
Input
30 40
Output
30 31 32 33 34 35 36 37 38 39
All numbers from 30 to 39 contain a 3.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
data9824