a =input()
a_num =int(a)
count =0for i inrange(int('9'*(5-len(a))),int('9'*(6-len(a)))):for n inrange(1, a_num):
stra =str(n)+str((a_num - n)*i)+str(i)for j inrange(9):ifstr(j+1)notin stra:
j =7breakif j ==8andlen(stra)==9:
count +=1print(count)
2.李白打酒
num =0defcount(a, b, c):global num
if a >0:
count(a -1, b, c *2)if b >0:
count(a, b -1, c -1)if a ==0and b ==0and c ==1:
num +=1
count(5,9,2)print(num)
a, b, c, d =map(int,input().split(' '))
step =[(1,2),(1,-2),(-1,2),(-1,-2),(2,1),(2,-1),(-2,1),(-2,-1)]
visit =[[False]*8for _ inrange(8)]
queue =[(a, b,0)]while queue:
y, x, t = queue.pop(0)if y == c and x == d:print(t)breakfor dy, dx in step:
ny = y + dy
nx = x + dx
if-1< ny <8and-1< nx <8andnot visit[ny][nx]:
queue.append((ny, nx, t+1))
visit[ny][nx]=Trueifnot queue:print(-1)
8.未名湖边的烦恼
m, n =map(int,input().split(' '))
record =[[-1]*(n+1)for _ inrange(m+1)]defdfs(a, b):# 还鞋、借鞋if a == b ==0:return1if record[a][b]!=-1:
ans = record[a][b]else:
ans =0if a >0:
ans += dfs(a-1, b)if0< b <= a:
ans += dfs(a, b-1)
record[a][b]= ans
return ans
print(dfs(m, n))