题意:
要买 个铲子,商店中有 中不同的卖法,依次每一次卖 到 个铲子,现在只能选择其中的一种买法,问最少买几次同一种的买法,使得刚好买到
直接选择小于 的
AC代码:
int n, m, k;
int main()
{
int t;
sd(t);
while (t--)
{
sdd(n, k);
int ans = inf;
for (int i = 1; i * i <= n; i++)
{
if (n % i == 0)
{
if (i <= k)
ans = min(ans, n / i);
if (n / i <= k)
ans = min(ans, i);
}
}
pd(ans);
}
return 0;
}