Chiaki Chain

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

Chiaki has a graph consisting of nn vertices and mm edges. Each edge connects two vertices. After a short time of research, she has realized that the graph may represents a special graph --  the kk-th order Chiaki Chain.

An ordinary chain is a graph consisting of a sequential (at least two) vertices. Each two adjacent vertices are connected by an edge. The kk-th order Chiaki Chain looks slightly different. There are kk sub-chains extended from the main chain from kk different vertices. At the end of each sub-chain, there is a simple cycle with length 3,4,,k+23,4,\dots,k+2. There is no useless vertices or edges in the kk-th order Chiaki Chain.

Chiaki would like to know whether the graph represents the kk-th order Chiaki Chain or not.

입력

There are multiple test cases. The first line of the input contains an integer TT, indicating the number of test cases. For each test case:

The first line contains three integers nn, mm and kk (1n,m,k2×1051 \le n,m, k \le 2 \times 10^5) -- the number of vertices and the number of edges in the graph and the order of Chiaki Chain.

Then followed by mm lines, each line contains two integers x_ix\_i and y_iy\_i (1x_i,y_in1 \le x\_i, y\_i \le n) representing the vertices the ii-th edge connected.

It is guaranteed that the sum of mm in all test cases will not exceed 2×1052 \times 10^5.

출력

For each test case, output "Yes" if the graph represents the kk-th order Chiaki Chain, or "No" if not.