#include <iostream>
#include <fstream>
#include <stack>
#include <iomanip>
#define double long double
using namespace std;
int n;
stack <pair <int, double>> stiva;
int main()
{
ios :: sync_with_stdio (0);
cin.tie (nullptr);
cin >> n;
for (int i=1;i<=n;i++)
{
int x, y;
cin >> x >> y;
double r=y;
while (!stiva.empty())
{
double len=(stiva.top().first-x)*(stiva.top().first-x);
r=min (r, len/(4*stiva.top().second));
if (r>stiva.top().second-1e-10)
{
stiva.pop();
}
else break;
}
cout << fixed << setprecision (3) << r << "\n";
stiva.push ({x, r});
}
return 0;
}
# | 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... |