Weird Coloring#3491

Weird Coloring

15 seconds
256 megabytes
Medium

You are given an undirected graph . You should paint the edges of with colors , , , ... such that:

  1. The sum of colors of all edges should be minimum.

  2. For each edge with color , there must be an adjacent edge such that the color of that edge is . Two edges are adjacent if they have a common vertex.

Input

First line of input contains the number of the tests.

For each case, first you are given 1 \le n \le 20 and 1 \le m \le 30, the number of vertices and edges respectively. In the following lines, in each line you are given two endpoints of an edge.

Output

For each case, output the minimum sum of colors of the edges.

Examples

Example 1

Loading
Loading