#graph204. POI 2008, BLO

POI 2008, BLO

POI 2008, BLO

Problem Description

Given an undirected connected graph with nn vertices and mm edges, with no multiple edges or self-loops. For each vertex, after deleting all its incident edges, how many pairs of vertices can no longer reach each other? The pairs are ordered, so (u,v)(u, v) and (v,u)(v, u) are counted twice.

Input Format

The first line contains two integers $n, m\ (1 \le n \le 10^5,\ 1 \le m \le 5 \times 10^5)$.

The next mm lines each contain two integers u,vu, v, denoting an undirected edge.

Output Format

nn lines, each containing one integer: the answer for the corresponding vertex.

Sample Input

5 5
1 2
2 3
1 3
3 4
4 5

Sample Output

8
8
16
14
8