#include using namespace std; int median(vector& v) { size_t n = v.size() / 2; nth_element(v.begin(), v.begin() + n, v.end()); return v[n]; } int main() { cin.tie(0)->sync_with_stdio(0); int N; cin >> N; vector X(N); vector Y(N); for (int i = 0; i < N; i++) { cin >> X[i] >> Y[i]; } int Xmed = median(X); int Ymed = median(Y); int ans = 0; for (int i = 0; i < N; i++) { ans += abs(X[i] - Xmed) + abs(Y[i] - Ymed); } cout << ans << endl; return 0; }