graph. When the professor asked him what the minimum number of vertices a simple, undirected graph with edges can have, he was unable to answer. Please help Wesley with this very simple task!is taking a course on the network simplex algorithm. Unfortunately, a term that comes up often in class is simple
A graph is simple if it contains no self loops (an edge from a vertex to itself) and no multiple edges between any two vertices. Note that an edge between vertices and is the same as an edge between and .
Since solving this problem once is easy, you will be asked to solve it times!
For this problem, you will be required to pass all the samples in order to receive any points. In addition, you must pass all previous subtasks to earn points for a specific subtask.
There will be multiple test cases.
The first line a single integer , the number of test cases.
Each test case consists of a single integer on its own line, the number of edges in the graph.
Note that a 64-bit integer may need to be used to store . In C++, this can be done with
long long. In Java, this can be done with
long. In Python, the standard
int will suffice.
This problem is graded with an
identical checker. This includes whitespace characters. Ensure that every line of output is terminated with a
\n character and that there are no trailing spaces.
For each test case, output a single integer on its own line, the minimum number of a vertices a simple, undirected graph with edges can have.
2 1 4
One possible graph for the first test case is shown below.
One possible graph for the second test case is shown below.