#include
#include
int main()
{
int n, x, i, j, m, N, s[10], a, b, c, d, e, f, h;
scanf("%d %d", &n, &x);
m = 0;
for (i=1; i<=n; i++) //n次循环,遍历n个数
{
a = i/1000000; //分解1000000内数字的各个位数字
b = (i%1000000) / 100000;
c = (i%100000) / 10000;
d = (i%10000) / 1000;
e = (i%1000) / 100;
f = (i%100) / 10;
h = i%10;
s[0] = h; //将各个位上的数字赋值到数组s中
s[1] = f;
s[2] = e;
s[3] = d;
s[4] = c;
s[5] = b;
s[6] = a;
if(i < 10) N = 1; //判断数字位数,将位数赋值给N作为循环搜索条件
if(9