No.1644 Eight Digits
問題文最終更新日: 2021-08-01 11:17:25
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 309
(順位表)
の他の問題:
Problem Statement
How many of the integers that can be formed by freely rearranging the digits of $12345678$ are multiples of $K$?
Input
$K$
- $1 \leq K \leq 87654321$
- All inputs are integers.
Output
Output the answer, followed by a newline.
Sample
Sample 1
Input
69921
Output
8
$42861573,85723146$ and others satisfy the condition. $139842$ is a multiple of $69921$, but it is not an integer that can be formed by freely rearranging the digits of $12345678$.
Sample 2
Input
1
Output
40320
The condition is satisfied no matter how the digits are rearranged.
Sample 3
Input
20212021
Output
0
The answer may be $0$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
蜜蜂