#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<queue>
using namespace std;
struct AAA{int a,c;};
queue<AAA>q;
int main()
{
int x1,x2,x3,cnt=0;
cin >> x1 >> x2 >> x3;/*
if(x1 == 680211&&x2 == 97&&x3 == 79)
{
cout << -1;
return 0;
}*/
q.push({1,0});
while(1)
{
int xx = q.front().a;
if(xx > 1000000)
{
q.pop();
continue;
}
int cx = q.front().c;
if(xx == x1){cout << cx;return 0;}
q.pop();
q.push({xx+x2,cx+1});
q.push({xx*x3+1,cx+1});
}
cout << -1;
}
求大神帮debug,当输入为680211,97,79时报错,本人是傻x,看不懂