- 最大gcd
真的不想努力了题解
- @ 2025-11-2 18:53:31
题解
设第 年的金额为,则有
化简一下:
其中。 根据状态转移方程可以得到:
为了使 ,只需要 即 。
代码
#include <bits/stdc++.h>
using namespace std;
using db = double;
void solve()
{
db r, b, c;
cin >> r >> b >> c;
r /= 100;
cout << (r + 1) * b / r / r + c / r << '\n';
}
signed main()
{
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int t;
cin >> t;
while (t--)
solve();
return 0;
}
0 comments
No comments so far...
Information
- ID
- 139
- Time
- ms
- Memory
- MiB
- Difficulty
- 10
- Tags
- (None)
- # Submissions
- 211
- Accepted
- 8
- Uploaded By