#abc319b. B - Measure
B - Measure
Score : points
问题描述
给定一个正整数 。打印一个长度为 的字符串 ,定义如下。
对于每个 ,
- 如果存在一个 的除数 ,满足 (含),且 是 的倍数,则 为对应于满足条件的最小这样的 的数字(因此 将会是
1
,2
, ...,9
中的一个);- 如果不存在这样的 ,则 为
-
。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a positive integer . Print a string of length , , defined as follows.
For each ,
- if there is a divisor of that is between and , inclusive, and is a multiple of , then is the digit corresponding to the smallest such ( will thus be one of
1
,2
, ...,9
);- if no such exists, then is
-
.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
12
Sample Output 1
1-643-2-346-1
We will explain how to determine for some .
-
For , the divisors of between and such that is a multiple of are . The smallest of these is , so
1
. -
For , the divisors of between and such that is a multiple of are . The smallest of these is , so
3
. -
For , there are no divisors of between and such that is a multiple of , so
-
.
Sample Input 2
7
Sample Output 2
17777771
Sample Input 3
1
Sample Output 3
11
update @ 2024/3/10 09:06:35