#include #include #include #include #include using namespace std; const int N=10006; struct Edge { int st, en; Edge() {} Edge(int a, int b) { st=a, en=b; } }; stack palm; vector arc[N]; vector block[N]; int dfn[N], low[N]; bool vs[N]; int n, m, ind, T, sum1, sum2; void tarjan(int u, int pre) { dfn[u]=low[u]=T++; int len=(int)arc[u].size(); for(int i=0; ilow[v]) low[u]=low[v]; if(dfn[u]<=low[v]) { for(Edge temp; !palm.empty(); ) { temp=palm.top(); if(dfn[temp.st]dfn[v]) low[u]=dfn[v]; } } } int main() { while(scanf("%d%d", &n, &m), n!=0 || m!=0) { for(int i=0; itot) sum2+=len; } printf("%d %d\n", sum1, sum2); } return 0; }