"Yes, I am the murderer. No doubt" I had to confess it in front of all. But wait, why I am confessing? Nobody wants to go to jail, neither do I. As you have suspected there is something fishy. So, let me explain a bit.
The incident occurred on June 19th, 2009, precisely at 11:30 pm as per the medical report. So, I posed a query to the judge: 'Could you ascertain the time 11:30 pm on June 19th in Bangladesh?' The judge, in turn, directed the reporters to determine the time. Alas! There was no record of "2009, June 19th, 11:30 pm". This left the judge bewildered regarding my confession. Consequently, I began to explain, "The time of the alleged murdren doesn't align with your records. So, how can you claim that I am the murderer?"
The rest, as they say, is history. I'm once again a free soul with a clean slate.
However, my intentions now lean towards another killing. I possess a roster of N mosquitoes marked for elimination. There's a hitch, though. If I terminate one mosquito, all its connected friends get wind of it, preparing for my offensive, rendering them invulnerable. But there's an intriguing twist — depicting them as nodes and their friendships as edges forms an acyclic graph.
Now, I'm plotting when and how to dispose of them (how to outmaneuver the law!) and you're tasked with writing a program to assist me in determining the maximum number of mosquitoes I can eliminate. Fear not, should anything go awry, your name shall not escape my lips. Trust me on this!
Input
Input starts with an integer T (≤ 50), denoting the number of test cases.
Each case starts with a blank line and two integers N (1 ≤ N ≤ 1000) denoting the number of mosquito I want to kill and M denoting the number of friendship configurations. Each of the next M lines contains two integers a and b denoting that ath and bth mosquitoes are friends. You can assume that (1 ≤ a, b ≤ N, a ≠ b) and each friendship relation is given only once. As I have already mentioned, you will not find any cycle in the relations.
Output
For each case, print the case number and the maximum number of mosquitoes I can kill considering the conditions described above.
Sample
Sample Input | Sample Output |
---|---|
3 4 3 1 2 1 3 1 4 3 2 1 2 2 3 5 4 1 2 1 3 2 4 2 5 | Case 1: 3 Case 2: 2 Case 3: 3 |