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 = 'from collections import deque,defaultdict\r\n\r\ndef addEdge(graph,u,v): \r\n\r\n    graph[u].append(v) \r\n    \r\n    \r\ndef bfs(graph, start):\r\n    # keep track of all visited nodes\r\n    explored = []\r\n    # keep track of nodes to be checked\r\n    queue = deque([start])\r\n\r\n    # keep looping until there are nodes still to be checked\r\n    while queue:\r\n        # pop shallowest node (first node) from queue\r\n        node = queue.popleft()\r\n        if node not in explored:\r\n            # add node to list of checked nodes\r\n            explored.append(node)\r\n            neighbours = graph[node]\r\n\r\n            # add neighbours of node to queue\r\n            for neighbour in neighbours:\r\n                queue.append(neighbour)\r\n    return explored\r\n \r\n       \r\ndef delete(graph,n)    :\r\n       try :\r\n           del graph[n]   \r\n       except KeyError :\r\n            pass   \r\n       for i in graph :\r\n           try :\r\n               graph[i].remove(n)\r\n           except ValueError :\r\n               continue     \r\n                      \r\n    \r\nfor _ in range( int(input())):\r\n    n,m=list(map(int,input().split()))\r\n    graph=defaultdict(list)\r\n    for i in range(m):\r\n        u,v=list(map(str,input().split())) \r\n        addEdge(graph,u,v)\r\n        addEdge(graph,v,u)        \r\n    cnt=0  \r\n    \r\n    dele=[]\r\n    for i in range(n):\r\n        if str(i)in dele :\r\n            \r\n            continue\r\n        else :      \r\n            path=bfs(graph,str(i))\r\n            for j in path :\r\n                delete(graph,j)\r\n                dele.append(j)\r\n            \r\n        cnt+=1\r\n     \r\n       \r\n    print(cnt)    \r\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14353