#35280: _c++


ericshen0922@gmail.com (little coderrr)

學校 : 不指定學校
編號 : 198722
來源 : [61.219.152.207]
最後登入時間 :
2025-09-29 20:54:28

#include<bits/stdc++.h>

using namespace std;

int main(){

int t;

cin>>t;

int max=-999;

int maxx=0;

int wr=0;

for(int i=0;i<t;++i){

int temp,temp2;

cin>>temp>>temp2;

if(temp2<0){

wr++;

 

}

else{

if(temp2>max){

maxx=temp;

max=temp2;

}

}

}

int ans;

ans=max-t-(wr*2);

if(ans>0){

cout<<ans<<" "<<maxx;

}

else{

cout<<0<<" "<<maxx;

}

 

}