Given a simple undirected connected graph $$$G$$$ with $$$n$$$ vertices and $$$m$$$ edges, you need to choose two distinct edges to delete, obtaining a new graph $$$G'$$$, such that $$$G'$$$ remains connected.
Let the two deleted edges be $$$(p,q)$$$ and $$$(u,v)$$$. You need to minimize the sum of the shortest path between $$$p$$$ and $$$q$$$ in $$$G'$$$ plus the shortest path between $$$u$$$ and $$$v$$$ in $$$G'$$$. Output this minimum value and the number of deletion schemes that achieve it.
This problem has multiple test cases.
The first line contains an integer $$$T$$$ — the number of test cases.
For each test case:
The first line contains two integers $$$n,m$$$.
The next $$$m$$$ lines each contain two integers $$$u,v$$$, representing an edge.
The graph has no multi-edges or self-loops. It is guaranteed that at least one deletion scheme exists such that the graph remains connected.
$$$1\le T\le 5000$$$, $$$1\le \sum n,\sum m \le 5000$$$, $$$4\le n$$$, $$$5\le m$$$.
For each test case:
Output a single line with two integers — the minimum value and the number of schemes.
44 61 21 31 42 32 43 44 51 22 33 41 41 35 61 32 31 42 41 52 55 71 22 33 44 51 52 51 4
4 15 4 4 6 12 4 4
| Название |
|---|


