简单题
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
#define maxn 105
int vis[maxn], n, m, k;
int f[maxn][maxn];
int main()
{
//freopen("t.txt", "r", stdin);
memset(f, 0, sizeof(f));
for (m = 2; m <= 100; m++)
{
memset(vis, -1, sizeof(vis));
n = 1;
vis[n] = 0;
int t = 1;
while (1)
{
n *= 10;
f[m][n / m]++;
n %= m;
if (vis[n] != -1 || n == 0)
break;
vis[n] = t++;
}
}
while (scanf("%d%d", &n, &k) != EOF)
{
int ans = 0;
for (int i = 2; i <= n; i++)
ans += f[i][k];
printf("%d\n", ans);
}
return 0;
}