设他用了 时间加速,则总时间为 ,然后直接用基本不等式求解即可。
#include<bits/stdc++.h>
#define int long long
#define double long double
#define x first
#define y second
using namespace std;
typedef long long LL;
typedef long long ll;
typedef pair<int, int> PII;
const int N = 3e5 + 10;
const int M = 1e3 + 10;
int mod = 1e9 + 7;
int a[N];
void solve() {
double v0, x, y;
cin >> v0 >> x >> y;
double s = sqrt(y * 1.0 / x), t = v0 * 1.0 / x;
if (s - t >= 0) cout << fixed << setprecision(10) << 2 * s - t << "\n";
else cout << fixed << setprecision(10) << y * 1.0 / v0 << "\n";
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int _;
_ = 1;
//cin>>_;
while (_--) {
solve();
}
}