CF1581B Diameter of Graph
Description
CQXYM wants to create a connected undirected graph with $ n $ nodes and $ m $ edges, and the diameter of the graph must be strictly less than $ k-1 $ . Also, CQXYM doesn't want a graph that contains self-loops or multiple edges (i.e. each edge connects two different vertices and between each pair of vertices there is at most one edge).
The diameter of a graph is the maximum distance between any two nodes.
The distance between two nodes is the minimum number of the edges on the path which endpoints are the two nodes.
CQXYM wonders whether it is possible to create such a graph.
Input Format
N/A
Output Format
N/A
Explanation/Hint
In the first test case, the graph's diameter equal to 0.
In the second test case, the graph's diameter can only be 2.
In the third test case, the graph's diameter can only be 1.