Submission #414582

#TimeUsernameProblemLanguageResultExecution timeMemory
414582aymanrsIzvanzemaljci (COI21_izvanzemaljci)C++14
5 / 100
30 ms3888 KiB
#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();
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...