AtCoder Grand Contest 067
A
Big Clique Everywhere
AtCoder
⌀ 2074
原题
←B →
翻译中…

Problem Statement

翻译中…

You are given a simple undirected graph $G$ with $N$ vertices numbered $1$ to $N$. $G$ has $M$ edges and the $i$-th edge connects vertices $A_i$ and $B_i$.

翻译中…

Check if $G$ satisfies the following condition:

翻译中…
  • For every subset $X$ of the vertex set $\{1,2,\cdots,N\}$, there exists a subset $Y$ of $X$ such that $|Y|\ge \frac{|X|}{2}$ and $Y$ forms a clique.
翻译中…

You have $T$ testcases to solve.

翻译中…

Constraints

翻译中…
  • $1\le T \le 10^3$
  • $1\le N \le 10^5$
  • $0 \le M \le 10^6$
  • $1 \le A_i,B_i \le N$
  • The given graph doesn't contain self-loops or multiple edges.
  • The sum of $N$ across the test cases in a single input is at most $10^5$.
  • The sum of $M$ across the test cases in a single input is at most $10^6$.
  • All input values are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

T
case_1
case_2
\vdots
case_T

翻译中…

Each test case is given in the following format:

翻译中…

N M
A_1 B_1
A_2 B_2
\vdots
A_M B_M

翻译中…

Output

翻译中…

For each test case, if $G$ satisfies the condition, print Yes, and otherwise print No. In printing Yes or No, you can output each letter in any case (upper or lower).

翻译中…

样例

Input #1
4
3 3
1 2
1 3
2 3
3 2
1 2
1 3
3 1
1 2
3 0
Output #1
Yes
Yes
Yes
No
For the $1$-st test case, $G$ satisfies the condition. In this case, every subset $X$ is a clique, so we can just let $Y=X$. For the $2$-nd test case, $G$ satisfies the condition. For example, for $X=\{2,3\}$, we can let $Y=\{2\}$. For the $4$-th test case, $G$ doesn't satisfy the condition. If we let $X=\{1,2,3\}$, no subset $Y$ of $X$ satisfies the condition.
题目信息
题号
agc067_a
时间限制
4 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。