There is a city with $N$ numbered $0 - N-1$ shops. A market is a place where we can reach from one shop to another using some road. There are $M$ roads in this city connecting each connecting any two shops. 
Find the number of markets in the city.
NOTE:  A market having only one shop is also a valid market.

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- First line of Each Test Case is $N, M$, denoting the number of shops and the number of roads respectively.
- Next M lines consist of two integers $A$ and $B$ denoting that there exists a road between Shop A and Shop B

-----Output:-----
For each testcase, output the number of markets.

-----Constraints-----
- $1 \leq T \leq 100$
- $1 \leq N,M \leq 10^3$
- $0 \leq A,B < N$

-----Sample Input:-----
1
5 3
0 1
2 3
3 4

-----Sample Output:-----
2

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'class Graph: \r\n      \r\n    # init function to declare class variables \r\n    def __init__(self,V): \r\n        self.V = V \r\n        self.adj = [[] for i in range(V)] \r\n  \r\n    def DFSUtil(self, temp, v, visited): \r\n  \r\n        # Mark the current vertex as visited \r\n        visited[v] = True\r\n  \r\n        # Store the vertex to list \r\n        temp.append(v) \r\n  \r\n        # Repeat for all vertices adjacent \r\n        # to this vertex v \r\n        for i in self.adj[v]: \r\n            if visited[i] == False: \r\n                  \r\n                # Update the list \r\n                temp = self.DFSUtil(temp, i, visited) \r\n        return temp \r\n  \r\n    # method to add an undirected edge \r\n    def addEdge(self, v, w): \r\n        self.adj[v].append(w) \r\n        self.adj[w].append(v) \r\n  \r\n    # Method to retrieve connected components \r\n    # in an undirected graph \r\n    def connectedComponents(self): \r\n        visited = [] \r\n        cc = [] \r\n        for i in range(self.V): \r\n            visited.append(False) \r\n        for v in range(self.V): \r\n            if visited[v] == False: \r\n                temp = [] \r\n                cc.append(self.DFSUtil(temp, v, visited)) \r\n        return len(cc) \r\n  \r\n# Driver Code \r\ndef __starting_point(): \r\n      \r\n    # Create a graph given in the above diagram \r\n    # 5 vertices numbered from 0 to 4 \r\n    t = int(input())\r\n    for _ in range(t):\r\n        n,m=list(map(int , input().strip().split()))\r\n        \r\n        g = Graph(n); \r\n        for _ in range(m):\r\n            a,b=list(map(int , input().strip().split()))\r\n            g.addEdge(a, b)\r\n        \r\n        \r\n        cc = g.connectedComponents() \r\n        #print("Following are connected components") \r\n        print(cc) \n__starting_point()'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 16997