This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n';
const int M = 1e2+15, MOD = 1000000007;
signed main() {
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
double x0, r0;
cin >> x0 >> r0;
cout << r0 << endl;
for (int i = 1; i < n; i++) {
int x, mr;
cin >> x >> mr;
double r = (x0-x)*(x0-x)/4.0/r0;
cout << fixed << setprecision(4) << min(r, double(mr)) << endl;
if (x*x/r < x0*x0/r0) {
x0 = x;
r0 = min(r, double(mr));
}
}
return 0;
}
/*
3 0 9 8 1 13 7
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |