#abc319b. B - Measure

B - Measure

Score : 200200 points

问题描述

给定一个正整数 NN。打印一个长度为 (N+1)(N+1) 的字符串 s0s1sNs_0s_1\ldots s_N,定义如下。

对于每个 i=0,1,2,,Ni = 0, 1, 2, \ldots, N

  • 如果存在一个 NN 的除数 jj,满足 1j91 \leq j \leq 9(含),且 iiN/jN/j 的倍数,则 sis_i 为对应于满足条件的最小这样的 jj 的数字(因此 sis_i 将会是 1, 2, ..., 9 中的一个);
  • 如果不存在这样的 jj,则 sis_i-

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a positive integer NN. Print a string of length (N+1)(N+1), s0s1sNs_0s_1\ldots s_N, defined as follows.

For each i=0,1,2,,Ni = 0, 1, 2, \ldots, N,

  • if there is a divisor jj of NN that is between 11 and 99, inclusive, and ii is a multiple of N/jN/j, then sis_i is the digit corresponding to the smallest such jj (sis_i will thus be one of 1, 2, ..., 9);
  • if no such jj exists, then sis_i is -.

Constraints

  • 1N10001 \leq N \leq 1000
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

NN

Output

Print the answer.

Sample Input 1

12

Sample Output 1

1-643-2-346-1

We will explain how to determine sis_i for some ii.

  • For i=0i = 0, the divisors jj of NN between 11 and 99 such that ii is a multiple of N/jN/j are 1,2,3,4,61, 2, 3, 4, 6. The smallest of these is 11, so s0=s_0 = 1.

  • For i=4i = 4, the divisors jj of NN between 11 and 99 such that ii is a multiple of N/jN/j are 3,63, 6. The smallest of these is 33, so s4=s_4 = 3.

  • For i=11i = 11, there are no divisors jj of NN between 11 and 99 such that ii is a multiple of N/jN/j, so s11=s_{11} = -.

Sample Input 2

7

Sample Output 2

17777771

Sample Input 3

1

Sample Output 3

11

update @ 2024/3/10 09:06:35