# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
919364 | buzdi | Balloons (CEOI11_bal) | C++11 | 0 ms | 0 KiB |
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 <fstream>
#include <iostream>
#include <stack>
#include <queue>
#include <algorithm>
#include <vector>
#include <cassert>
#include <map>
#include <iomanip>
#define ll long long
using namespace std;
const int NMAX = 2e5;
struct Point
{
int x, y;
void Read()
{
cin >> x >> y;
}
};
int n;
Point a[NMAX + 1];
long double answer[NMAX + 1];
stack<Point> st;
ll Square(int x)
{
return (ll) x * x;
}
long double Radius(Point p1, Point p2)
{
return (long double) Square(p2.x - p1.x) / (long double)(4.0 * p1.y);
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
for(int i = 1; i <= n; i++)
a[i].Read();
for(int i = 1; i <= n; i++)
for(int j = 1; j < i; j++)
a[i].y = min(a[i].y, Radius(a[j], a[i]));
for(int i = 1; i <= n; i++)
cout << fixed << setprecision(3) << a[i].y << '\n';
return 0;
}