链接:
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=112&page=show_problem&problem=1565
原题:
Don't you think 162456723 very special? Look at the picture below if you are unable to find its speciality. (a | b means ‘b is divisible bya’)
Figure: Super Numbers
Given n, m (0 < n < m < 30), you are to find a m-digit positive integer X such that for every i (n <= i <= m), the first i digits of X is a multiple of i. If more than one such X exists, you should output the lexicographically smallest one. Note that the first digit of X should notbe 0.
Input
The first line of the input contains a single integer t(1 <= t <= 15), the number of test cases followed. For each case, two integers n and mare separated by a single space.
Output
For each test case, print the case number and X. If no such number, print -1.
样例输入:
2
1 10
3 29
样例输出:
Case 1: 1020005640
Case 2: -1
题目大意:
所谓的超级数字,就是指一个数字,从左边位数开始, 前i位能被i整数
输入n, m, 第n为开始要满足超级数字的要求。
以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索find
, super
You
liurujia daima、rujia、nvyongrujia、rujiajiudian、rujia1,以便于您获取更多的相关知识。