#include <bits/stdc++.h>
using namespace std;
void solve(){
int n, k;
cin >> n >> k;
pair<long long, long long> co[n];
for(int i = 0;i < n;i++){
cin >> co[i].first >> co[i].second;
}
if(k==1){
long long xx = LONG_LONG_MIN, xy = LONG_LONG_MIN, mx = LONG_LONG_MAX, my = LONG_LONG_MAX;
for(int i = 0; i < n;i++){
xx = max(xx, co[i].first);
xy = max(xy, co[i].second);
mx = min(mx, co[i].first);
my = min(my, co[i].second);
}
cout << mx << ' ' << my << ' ' << max(max(xx - mx, xy - my), 1LL) << '\n';
}
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t = 1;
//cin >> t;
while(t--) {
solve();
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
29 ms |
3772 KB |
Output is correct |
8 |
Correct |
29 ms |
3880 KB |
Output is correct |
9 |
Correct |
29 ms |
3884 KB |
Output is correct |
10 |
Correct |
30 ms |
3888 KB |
Output is correct |
11 |
Correct |
29 ms |
3768 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Unexpected end of file - int64 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Unexpected end of file - int64 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Unexpected end of file - int64 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Unexpected end of file - int64 expected |
2 |
Halted |
0 ms |
0 KB |
- |