This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
int x[n]; int y[n];
for(int i = 0; i < n; i ++){cin >> x[i]; cin >> y[i];}
sort(x, x + n);
sort(y, y + n);
if(n % 2 == 1){cout << x[int((n + 1)/2) - 1] << " " << y[int((n + 1)/2) -1] << "\n";}
else{
int x_avg = x[int(n/2) - 1] + x[int(n/2)];
int y_avg = y[int(n/2) - 1] + y[int(n/2)];
cout << int(x_avg/2) << " " << int(y_avg/2) << "\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |