Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- struct Pos{
- int x;
- int y;
- Pos(){};
- Pos(int x1, int y1){
- x = x1;
- y = y1;
- };
- };
- int main(){
- ios_base::sync_with_stdio(0), cin.tie(0);
- // freopen("DanceParty.in", "r", stdin);
- int n;
- cin >> n;
- int x, y;
- Pos pos[n];
- for(int i=1; i<=n; i++){
- cin >> x >> y;
- pos[i] = Pos(x, y);
- // cout << pos[i].x << ", " << pos[i].y << '\n';
- }
- int ans1 = 0, ans2 = 0;
- int ax = 0, ay = 0;
- for(int i=1; i<=n; i++){
- for(int j=i+1; j<=n; j++){
- int sx = (pos[i].x-pos[j].x)*(pos[i].x-pos[j].x);
- int sy = (pos[i].y-pos[j].y)*(pos[i].y-pos[j].y);
- // cout << "i: " << i << ", j: " << j << ", pos[i].x: " << pos[i].x << ", pos[i].y: " << pos[i].y << ", pos[j].x: " << pos[j].x << ", pos[j].y: " << pos[j].y << ", sx: " << sx << ", sy: " << sy << '\n';
- // cout << "sx: " << sx << ", sy: " << sy << '\n';
- int ts = sx+sy;
- if(ts>ax+ay){
- // cout << "i: " << i << ", j: " << j << ", ts: " << ts << ", ax+ay: " << ax+ay << '\n';
- ax = sx;
- ay = sy;
- ans1 = i;
- ans2 = j;
- }
- }
- }
- cout << ans1 << " " << ans2 << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement