mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
20 lines
413 B
C++
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;
|
||
|
}
|