Ghostwriter program Programming,Help With Python，c++ Course Programming,Ghostwriter Java Programming
Ghostwriter Java ProgrammingGhostwriter Web
Return to Problem List
Time Remaining: 1 hrs, 32 min, 26 sec
Not submitted yet
Bessie has a connected, undirected graph with vertices labeled and edges ( ).
may contain selfloops (edges from nodes back to themselves), but no parallel edges (multiple edges connecting the same
endpoints).
Let be a boolean function that evaluates to true if there exists a path from vertex to vertex that traverses exactly
edges for each and , and false otherwise. If an edge is traversed multiple times, it is included that many times in
the count.
Elsie wants to copy Bessie. In particular, she wants to construct an undirected graph such that for all and
.
Elsie wants to do the least possible amount of work, so she wants to construct the smallest possible graph. Therefore, your job is
to compute the minimum possible number of edges in .
Each input contains ( ) test cases that should be solved independently. It is guaranteed that the sum of over
all test cases does not exceed , and the sum of over all test cases does not exceed .
INPUT FORMAT (input arrives from the terminal / stdin):
The first line of the input contains , the number of test cases.
The first line of each test case contains two integers and .
The next lines of each test case each contain two integers and ( ), denoting that there exists an edge
between and in .
Consecutive test cases are separated by newlines for readability.
OUTPUT FORMAT (print output to the terminal / stdout):
For each test case, the minimum possible number of edges in on a new line.
SAMPLE INPUT:
In the first test case, Elsie can construct by starting with and removing . Or she could construct a graph with the
In each of these test cases, Elsie cannot do better than Bessie.
SCORING:
All test cases in input 3 satisfy .
All test cases in inputs 45 satisfy .
For all test cases in inputs 69, if it is not the case that for all , then there exists such that is
true and is false.
All test cases in inputs 1015 satisfy .
Test cases in inputs 1620 satisfy no additional constraints.
Contact Us(Ghostwriter Service)
 QQ：99515681
 WeChat：codinghelp2
 Email：99515681@qq.com
 Work Time：8:0023:00

Cs246110 Programminghelp With ,Ghostw...
20210302

Ghostwriter Program Programming,Help W...
20210302

Programming Coursehelp With ,Ghostwrit...
20210302

Ghostwriter Csc1Ua Programming,Help W...
20210302

Help With Program Programming,Ghostwri...
20210302

Ghostwriter Data Programming,Help With...
20210302

Cse 13S Programminghelp With ,Ghostwri...
20210302

Mat136h5 Programminghelp With ,C/C++ P...
20210301

Ghostwriter Ee425x Programming,Help Wi...
20210301

Cscc11 Programming Coursehelp With ,Gh...
20210301

Ghostwriter Program Programming,Python...
20210301

Help With R ProgrammingHelp With Data...
20210301

Data Structuresghostwriter ,Help With ...
20210301

Help With Data Programming,C++，Python...
20210301

Ghostwriter Aps 105 Programming,C/C++ ...
20210301

Fre6831 Computational Finance
20210228

Sta141b Assignment 5 Interactive Visu...
20210228

Eecs2011aF20
20210228

Comp251 Final Asssessment
20210228

Ghostwriter Cs1027 Course Programming,...
20210228
Contact Us  Email：99515681@qq.com WeChat：codinghelp
Programming Assignment Help！