编辑代码

#include<iostream>
#include<cmath>
using namespace std;

double x,n;

int main()
{

    cin>>x>>n;
    if(x<=2&&n>2)
        cout<<"inf";
    else if(x>=pow(2,n))
        cout<<0;
    else if(x*x>=pow(2,n))
        cout<<1;
    else
        cout<<ceil(log2((n-2)/(log2(x)-1)));

    return 0;
}