The FME graph (1)

A rookie is curious about what the FME graph is. After some days, he
learns that it is an undirected graph where the vertices are the FME
students, and there is an edge between x and y if they had an affair at
some moment. There is no more than one edge between each pair x and y,
nor edges of the kind x x.

Suppose that someone gives you the number of vertices n and the number
of edges m. With this information, can you tell if the graph is
connected, if it is not, or that you are being fooled?

Input

Input consists of several cases. Every case has the supposed numbers of
vertices and edges of an undirected graph. You can assume 2 ≤ n ≤ 10⁹
and 0 ≤ m ≤ 10⁹.

Output

For every case, tell if you can assure that the graph is connected, if
you can assure that the graph is not connected, if it is impossible that
such a graph exists, or if we are in none of those situations.

Problem information

Author: Ferran Alet

Generation: 2026-01-25T11:13:01.138Z

© Jutge.org, 2006–2026.
https://jutge.org
