Advertisement
Cati29

922

Feb 9th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. struct Pct
  5. {
  6. int x;
  7. int y;
  8. };
  9. int main()
  10. {
  11. Pct a[1001];
  12. int n, i, nr = 0;
  13. double dmax = 0,dist;
  14. cin >> n;
  15. for(i = 1; i <= n; i++)
  16.  
  17. {
  18. cin >> a[i].x >> a[i].y;
  19. dist = sqrt(a[i].x *a[i].x + a[i].y * a[i].y);
  20. if(dist > dmax)
  21. {
  22. dmax = dist;
  23. nr++;
  24. }
  25.  
  26. }
  27. cout << setprecision(4) << dmax << " " << nr;
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement