http://acm.hit.edu.cn/hoj/problem/view?id=2519
分成3堆
以sample in 20为例
①6 6 8
若fake在6
②2 2 2
③1 1
若fake在8
②3 3 2
③1 1 1或1 1
#include <stdio.h>
#include <math.h>
int main()
{
int cases, n , m;
scanf("%d", &cases);
while (cases--)
{
scanf("%d", &n);
m = ceil(log(n) / log(3) );
printf("%d\n", m);
}
return 0;
}