#include #include #include using namespace std; int main() { int q1, q2; int m, n; while (scanf("%d %d", &n, &m) != EOF) { int ct = 0; for(int i=0; i < m; i++) { scanf("%d %d", &q1, &q2); if (q1 == 1 && q2 == n || q2 == 1 && q1 == n) { ct++; } } if (ct == 0) { cout << 1 << " " << 1 << endl; } else { cout << 1 << " " << n*(n-1)/ 2 << endl; } } }