#include #include #include #define rep(i_, s_, t_) for (int i_ = (s_); i_ <= (t_); ++i_) #define re(i_, s_, t_) for (int i_ = (s_); i_ < (t_); ++i_) #define per(i_, s_, t_) for (int i_ = (s_); i_ >= (t_); --i_) typedef long long ll; typedef const int cint; #ifdef AKARI void cca() { std::cerr << "\033[39;0m" << std::endl; } template void cca(T a, Args... args) { std::cerr << a << ", "; cca(args...); } #define ccc(args...) std::cerr << "\033[32;1m" << #args << " = ", cca(args) #define ccf(args...) fprintf(stderr, args) #define crep(i_, s_, t_) rep(i, s_, t_) #else #define ccc(...) 0 #define ccf(...) 0 #define crep(...) if (0) #endif int deg[503]; int main() { int T; scanf("%d", &T); while (T--) { int n, m, k; scanf("%d%d%d", &n, &m, &k); while (m--) { int u, v; scanf("%d%d", &u, &v); ++deg[u]; ++deg[v]; } bool ok = true; rep (i, 1, n) { if (deg[i] < k) ok = false; deg[i] = 0; } puts(ok ? "Yes" : "No"); } }