Highway Racing Tracks

No attempts yetTime limit1sMemory limit128 MB

Problem

The government of the Land Beyond the Looking-Glass has announced that it will build a large network of high-speed roads. In the plan, every road is two-way and is identified by a unique number. Each road connects two different roundabouts, and any two roundabouts are joined by at most one road. The roads never cross one another — tunnels and bridges are built wherever needed.

An illegal racing club was delighted by the announcement. To hold a race the club needs exactly four connected roads that together form a racing track. A racing track must pass through exactly five different roundabouts (in particular, the starting roundabout must differ from the finishing one): it is a chain of roundabouts r1r2r3r4r5r_1 - r_2 - r_3 - r_4 - r_5 in which all five roundabouts are distinct and every consecutive pair is joined by a road.

Two races are considered different when their racing tracks differ. Two racing tracks are the same when they consist of exactly the same set of four roads, and different when they differ in at least one road (so travelling the same track in the opposite direction gives the same track).

Given the planned road network, count how many different racing tracks the club could hold.

Input

The first line contains an integer dd (1d1001 \le d \le 100) — the number of test cases.

For each test case, the first line contains two integers nn and mm (1n2001 \le n \le 200; 0mn(n1)/20 \le m \le n(n-1)/2), where nn is the number of roundabouts and mm is the number of roads. Each of the next mm lines contains two integers uu and vv (1u,vn1 \le u, v \le n), meaning that roundabout uu is connected to roundabout vv by a road.

Output

For each test case, print on its own line the number of different racing tracks that can be built on the given road network.