- 最大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 条评论
目前还没有评论...
信息
- ID
- 139
- 时间
- ms
- 内存
- MiB
- 难度
- 1
- 标签
- (无)
- 递交数
- 50
- 已通过
- 48
- 上传者