#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<algorithm>#include<string>#include<vector>#include<map>using namespace std;long long a[29111];int main(){ int t; scanf("%d",&t); while(t--) { int n,m,i,k=0; scanf("%d%d",&m,&n); a[0]=1; for(i=0;a[i]<=n;i++) { while(a[k]*m<a[i]) k++; a[i+1]=a[i]+a[k]; } printf("%dn",n-i); } return 0;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)