Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- struct Pct
- {
- int x;
- int y;
- };
- int main()
- {
- Pct a[1001];
- int n, i, nr = 0;
- double dmax = 0,dist;
- cin >> n;
- for(i = 1; i <= n; i++)
- {
- cin >> a[i].x >> a[i].y;
- dist = sqrt(a[i].x *a[i].x + a[i].y * a[i].y);
- if(dist > dmax)
- {
- dmax = dist;
- nr++;
- }
- }
- cout << setprecision(4) << dmax << " " << nr;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement