题目链接:https://acs.jxnu.edu.cn/problem/ICPCJX2020F
描述:
我们认为一个自然数P有K个数字, a1a2..ak(a1≠0),只有满足下列条件才合法:
每个由 p 的前导数字组成的数字都可以被它的位数整除。
更正式地,, ∀i∈[1,k]∀i∈[1,k],i|a1a2..ai。
例如,123是合法的,因为,1|1, 2|12, 3|123。
然而,124是不合法的,因为3∤124。
每个数字都可以通过以下方式用火柴棒组成。
你能用n根火柴棍组成的最大可能的魔法数字是多少?
输入:
输入包含一个整数n(1≤n≤10100),代表你拥有的木柴数。
输出:
输出看可能由N根火柴组成的最大魔法数。
如果数字不存在,输出-1‘
生词:composed 组成,构成
formally 正式
sticks 火柴,棍
digits.数字,位 ,码字