#arc161f. [arc161_f]Everywhere is Sparser than Whole (Judge)
[arc161_f]Everywhere is Sparser than Whole (Judge)
Problem Statement
We define the density of a non-empty simple undirected graph as .
You are given positive integers , , and a simple undirected graph with vertices and edges. The vertices of are numbered from to , and the -th edge connects vertex and vertex . Determine whether satisfies the following condition.
Condition: Let be the vertex set of . For any non-empty proper subset of , the density of the induced subgraph of by is strictly less than .
There are test cases to solve.
What is an induced subgraph?
For a vertex subset of graph , the induced subgraph of by is the graph with vertex set and edge set containing all edges of that connect two vertices in . In the above condition, note that we only consider vertex subsets that are neither empty nor the entire set.
Constraints
- The sum of over the test cases in each input file is at most .
Input
The input is given from Standard Input in the following format:
Each test case is in the following format:
Output
Print lines. The -th line should contain Yes
if the given graph for the -th test case satisfies the condition, and No
otherwise.
Sample Input 1
Sample Output 1
- The first test case is the same as Sample Input 1 in Problem D, and it satisfies the condition.
- For the second test case, the edge set of the induced subgraph by the non-empty proper subset of the vertex set is , and its density is . Therefore, this graph does not satisfy the condition.