英语翻译06

2022 01.24 

https://acs.jxnu.edu.cn/problem/ICPCJX2020Ficon-default.png?t=M0H8https://acs.jxnu.edu.cn/problem/ICPCJX2020F

Magical Number

神奇的数字啊

 1000ms  131072K

描述:

We consider a natural number p with k digits, a1a2..ak¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯(a1≠0)a1a2..ak¯(a1≠0), is magical only when it satisfies:

我们考虑了一个具有 k个数的自然数p,即a1a2。ak(a1)≠0)a1a2。。ak'(a1≠只有在满足以下条件时才具有魔力:

Every number composed by leading digits of p can be divisible by the number of its digits.

由p的前导数字组成的每个数字都可以被其位数整除。

More formally, ∀i∈[1,k]∀i∈[1,k],i|a1a2..ai¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯i|a1a2..ai¯。

通常,∀i∈[1,k]∀i∈[1,k],i|a1a2..ai¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯i|a1a2..ai¯。

For example, 123 is magical, because 1|1, 2|12, 3|123

例如,123是神奇的,因为 1|1, 2|12, 3|123

However,124is not magical, because 3∤124。

然而,124不是神奇的,因为124%3!=0,。

Every digit can be composed with match sticks in the following ways.

每个数字都能用n个火柴棒组成以下的方式;

What is the largest posible magical number you can compose with exactly nn match sticks?

你能用火柴棒创作的最大可能的魔法数字是什么?

输入:

The input contains a integer n(1≤n≤10100)n(1≤n≤10100), the number of match sticks you have .

输入包含一个整数n(1)≤N≤10100)n(1)≤N≤10100),您拥有的火柴棒数量。

输出:

Print the largest posible magical number x that can be possibly composed with exactly n match sticks.

If the number doesn't exist, print −1.

打印最大可能的神奇数字x,它可能由n个火柴棒组成。

如果号码不存在,请打印−1.

样例输入:

3

样例输出:

7

样例输入:

7

样例输出:

74

样例输入:

10000

样例输出:

-1

 divisible 可除尽的

digit 数字

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值