OJ-Problems-Source/HDOJ/5422_autoAC.cpp
KiritoTRw b39288d6ef Powered By HC TECH : AutoACer Engine
5400-5504(END by now)
2016-09-13 04:55:33 +08:00

20 lines
413 B
C++

#include <iostream>
using namespace std;
int main(){
int n,m,a,b,sign;
while(cin>>n>>m){
sign=0;
while(m--){
cin>>a>>b;
if((a==1&&b==n)||(b==1&&a==n))
sign=1;
}
n=n*(n-1)/2;
if(sign)
cout<<"1 "<<n<<endl;
else
cout<<"1 1"<<endl;
}
return 0;
}