Răspuns:
Explicație:
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
ifstream f("disc.in");
ofstream g("disc.out");
struct disc{float x,y,R;}d[30];
int n,i,j;
float dist;
int main()
{
f >> n;
for (i=0; i<n; ++i)
{
f >> d[i].x >> d[i].y >> d[i].R;
}
for (i=0; i<n-1; ++i)
{
for (j=i+1; j<n; ++j)
{
if (d[i].R < d[j].R) swap(d[i],d[j]);
}
}
g << d[0].x << " " << d[0].y << " " << d[0].R << "\n";
for (i=1; i<n; ++i)
{
dist=sqrt(pow(d[0].x-d[i].x,2)+pow(d[0].y-d[i].y,2));
if (dist+d[i].R<d[0].R)
g << d[i].x << " " << d[i].y << " " << d[i].R << "\n";
}
}