Problem Statement

You are given an undirected graph with nn vertices and mm edges. Pondo would like you to determine the number of 33-cycles in the graph. A 33-cycle (triangle) is a cycle of length 33 in the graph.

Input Statement

Your first line will contain two space-separated integers nn and mm (respectively).

Your next line mm lines will contain two space-separated integers each, uu and vv, representing an edge between nodes uu and vv.

Output Statement

You should output a single integer representing the number of 33-cycles in the given graph.

Constraints

  • 1≤n≤1041 \leq n \leq 10^4
  • 1≤m≤min⁡(104,n⋅(n−1)2)1 \leq m \leq \min(10^4, \frac{n \cdot (n - 1)}{2})
  • 1≤u,v≤n1 \leq u, v \leq n
  • all u,vu, v pairs are unique and u≠vu \neq v

Sample Cases

Input 1
5 10
1 2
1 3
1 4
1 5
2 3
2 4
2 5
3 4
3 5
4 5
Output 1
10
Explanation 1

Notice that all triples of nodes form 33-cycles.

Input 2
6 8
1 2
1 3
2 3
2 4
3 5
4 5
4 6
5 6
Output 2
2
Explanation 2

There are only two 33-cycles formed by (1,2,3)(1, 2, 3) and (4,5,6)(4, 5, 6).

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.