2142: A Famous King’s Trip
题目描述
输入
For each test case, the first line contains two integers, n and m (1 <= n, m <= 200,000), indicating the number of cities in the Kingdom and the roads in Mr. B's original plan. Following this are m lines, each contains a pair of integers a and b, denoting a bidirectional road between city a and city b (1 <= a, b <= n and a != b), the number of cities are counted from 1. No two roads connect the same pair of cities.
输出
For each test case, if Mr. B can satisfy the King’s requirement, then output “YES” in the first line, otherwise output “NO” (quotes for clarifying). If the answer is “YES”, output two integers X and Y (X < Y) in the following line, specifying the two roads that Mr. B should delete from the original design. X and Y are the indexes of roads in the input, counting from 1. If there are more than one possible answer, output the one that makes the pair of (X, Y) lexicographically smallest.
样例输入 复制
4 6
1 2
1 3
1 4
2 3
2 4
3 4
样例输出 复制
Case 1: YES
1 6