Submission

Status:

[-SSSS][SSSSS][SSSSSSSSSS]

Subtask/Task Score:

{0/20}{0/30}{0/50}

Score: 0

User: robgornpeunpadpairoundnigumaipadnea

Problemset: ห้องสมุดเมือง 3M

Language: cpp

Time: 0.002 second

Submitted On: 2025-11-19 22:42:42

#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int n;cin>>n;
    vector<ll> v;
    ll cnt=0;
    while(n--){
        ll a,b;
        cin>>a>>b;
        for(int i=a;i<b;i++){v.push_back(i);cnt++;}
    }
    sort(v.begin(),v.end());
    for(auto e:v)cout << e << ' ';
    cout << '\n';
    if(cnt % 2 ==0)cout << v[cnt/2-1];
    else cout << v[cnt/2-1];
}