Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define F first
- #define S second
- #define int long long
- #define double long double
- int distance(int x1 , int y1 , int x2, int y2){
- int d = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
- return d;
- }
- signed main()
- {
- int n;
- cin >> n;
- vector<pair<int , int> > v(n);
- for(int i = 0; i < n; i++){
- cin >> v[i].F >> v[i].S;
- }
- int ans = 0;
- for(int i = 0; i < n; i++){
- for(int j = i + 1; j < n; j++){
- ans = max(ans , distance(v[i].F , v[i].S , v[j].F , v[j].S));
- }
- }
- double sq = sqrtl(ans);
- cout << setprecision(6) << fixed << sq << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement