题解
2023-05-27 17:28:25
发布于:上海
42阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
long long A, B, L, ans_a, ans_b;
int main() {
cin >> A >> B >> L;
for (long long b = 1; b <= L; b ++) {
long long a = (A * b + B - 1) / B;
if (a > L) continue;
if (!ans_b || ans_a * b > a * ans_b) {
ans_a = a;
ans_b = b;
}
}
cout << ans_a << " " << ans_b << endl;
return 0;
}
这里空空如也
有帮助,赞一个