Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include<iomanip>
- using namespace std;
- struct punct
- {
- int x,y,d;
- };
- punct v[101];
- int n;
- int distanta(int x,int y)
- {
- return x*x+y*y;
- }
- void citire ()
- {
- int i,dmax=0,k=0;
- cin>>n;
- for(i=1;i<=n;i++)
- {
- cin>>v[i].x>>v[i].y;
- v[i].d=distanta(v[i].x,v[i].y);
- if(v[i].d>dmax)
- dmax=v[i].d;
- }
- for(i=1;i<=n;i++)
- if(v[i].d==dmax)
- k++;
- double dreal=sqrt((double)dmax);
- dreal=dreal*1000;
- dmax=(int)dreal;
- dreal=(double)dmax/1000;
- cout<<fixed<<setprecision(3)<<dreal<<" "<<k;
- }
- int main()
- {
- citire();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement