http://acm.hit.edu.cn/hoj/problem/view?id=1610
N个物品 每个问题K个答案 问最多问几个问题可以确定某个物品
取对数即可
#include <stdio.h>
#include <math.h>
int main()
{
double n, k, m;
while (scanf("%lf %lf", &k, &n) != EOF)
{
if(n == 0 && k == 0)
break;
m = ceil(log(n)/log(k)) +1;
printf("%.0lf items, %.0lf answers per question, %.0lf questions\n", n, k, m);
}
return 0;
}