#include #include typedef long long LL; const int M = 305; const int Mod = 1000000007; const double eps = 1e-9; LL p[M]; bool vis[M]; LL t,n,m,k; struct node { LL u,v; }s[M]; LL Read() { LL x1 = 0,f1 = 1;char c1 = getchar(); while(c1 > '9' || c1 < '0'){if(c1 == '-')f1 = -1;c1 = getchar();} while(c1 >= '0' && c1 <= '9'){x1 = (x1*10) + (c1^48);c1 = getchar();} return x1 * f1; } int main() { for(LL T = Read(); T ;-- T) { n = Read(); m = Read(); k = Read(); memset(p,0,sizeof(p)); memset(vis,0,sizeof(vis)); for(int i = 1;i <= m;++ i) { s[i].u = Read(); s[i].v = Read(); p[s[i].u]++; p[s[i].v]++; } bool f = 0; for(int i = 1;i <= n;++ i) if(p[i] < k) { f = 1; break; } if(f) puts("No"); else puts("Yes"); } }