# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1157677 | adlin | Road Construction (JOI21_road_construction) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
using namespace std;
typedef long long ll;
const int maxn = 250001;
int n,k;
pair <int,int> a[maxn];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> k;
for(int i = 1; i <= n; i++){
cin >> a[i].F >> a[i].S;
}
vector <int> v;
for(int i = 1; i <= n; i++){
for(int j = i + 1; j <= n; j++){
v.pb(abs(a[i].F-a[j].F) + abs(a[i].S-a[j].S));
}
}
sort(all(v));
for(int i = 0; i < v.size(); i++) cout << v[i] << '\n';
return 0;
}