70求调
查看原帖
70求调
551630
Lemon_zqp楼主2024/3/21 17:59
#include<bits/stdc++.h>
const int mod = 1e9 + 7;
using namespace std;

int main()
{
	int t;
	cin >> t;
	while(t--){
		int x, a, b;
		cin >> x >> a >> b;
		int last;
		last = x;
		bool if_s = false;
		while(x >= 0){
			x = (a * x) - b;
			if(last <= x){
				cout << last << endl;
				if_s = true;
				break;
			}
			last = x;
		}
		if(!if_s){
			cout << last << endl;
		}
	}
	return 0;
}
2024/3/21 17:59
加载中...