{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cdiv\u003e\u003cp\u003eA network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of computers are connected directly or indirectly by successive links, so data can be transformed between any two computers. The administrator finds that some links are vital to the network, because failure of any one of them can cause that data can\u0027t be transformed between some computers. He call such a link a bridge. He is planning to add some new links one by one to eliminate all bridges.\u003c/p\u003e\u003cp\u003eYou are to help the administrator by reporting the number of bridges in the network after each new link is added. \u003c/p\u003e\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cdiv\u003e\u003cp\u003eThe input consists of multiple test cases. Each test case starts with a line containing two integers \u003ci\u003eN\u003c/i\u003e(1 \u0026le; \u003ci\u003eN\u003c/i\u003e \u0026le; 100,000) and \u003ci\u003eM\u003c/i\u003e(\u003ci\u003eN\u003c/i\u003e - 1 \u0026le; \u003ci\u003eM\u003c/i\u003e \u0026le; 200,000).\u003cbr\u003eEach of the following M lines contains two integers \u003ci\u003eA\u003c/i\u003e and \u003ci\u003eB\u003c/i\u003e ( 1\u0026le; \u003ci\u003eA\u003c/i\u003e \u0026ne; \u003ci\u003eB\u003c/i\u003e \u0026le; N), which indicates a link between computer \u003ci\u003eA\u003c/i\u003e and \u003ci\u003eB\u003c/i\u003e. Computers are numbered from 1 to \u003ci\u003eN\u003c/i\u003e. It is guaranteed that any two computers are connected in the initial network.\u003cbr\u003eThe next line contains a single integer \u003ci\u003eQ\u003c/i\u003e ( 1 \u0026le; \u003ci\u003eQ\u003c/i\u003e \u0026le; 1,000), which is the number of new links the administrator plans to add to the network one by one.\u003cbr\u003eThe \u003ci\u003ei\u003c/i\u003e-th line of the following \u003ci\u003eQ\u003c/i\u003e lines contains two integer \u003ci\u003eA\u003c/i\u003e and \u003ci\u003eB\u003c/i\u003e (1 \u0026le; \u003ci\u003eA\u003c/i\u003e \u0026ne; \u003ci\u003eB\u003c/i\u003e \u0026le; \u003ci\u003eN\u003c/i\u003e), which is the \u003ci\u003ei\u003c/i\u003e-th added new link connecting computer \u003ci\u003eA\u003c/i\u003e and \u003ci\u003eB\u003c/i\u003e.\u003cbr\u003e\u003cbr\u003eThe last test case is followed by a line containing two zeros.\u003cbr\u003e\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cdiv\u003e\u003cp\u003eFor each test case, print a line containing the test case number( beginning with 1) and \u003ci\u003eQ\u003c/i\u003e lines, the \u003ci\u003ei\u003c/i\u003e-th of which contains a integer indicating the number of bridges in the network after the first \u003ci\u003ei\u003c/i\u003e new links are added. Print a blank line after the output for each test case.\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e3 2\r\n1 2\r\n2 3\r\n2\r\n1 2\r\n1 3\r\n4 4\r\n1 2\r\n2 1\r\n2 3\r\n1 4\r\n2\r\n1 2\r\n3 4\r\n0 0\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003eCase 1:\r\n1\r\n0\r\n\r\nCase 2:\r\n2\r\n0\u003c/pre\u003e"}}]}