{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that starting from an intersection and walking through the town\u0027s streets you can never reach the same intersection i.e. the town\u0027s streets form no cycles. With these assumptions your task is to write a program that finds the minimum number of paratroopers that can descend on the town and visit all the intersections of this town in such a way that no intersection is visited by more than one paratrooper. Each paratrooper lands at an intersection and can visit other intersections following the town streets. There are no restrictions on the starting intersection for each paratrooper."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 100)**, denoting the number of test cases.\n\nEach case starts with a blank line. Next line contains two integers **n (1 \u0026le; n \u0026le; 1000)** and **m (0 \u0026le; m \u0026le; 10000)** where **n** denotes the number of intersections and **m** denotes the number of one-way streets. Intersections are numbered from **1** to **n**. Each of the next **m** lines contains two integers **u v (1 \u0026le; u, v \u0026le; n, u \u0026ne; v)** denoting a one-way street from intersection **u** to **v**. There can be at most one street from one intersection to another."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and the minimum number of paratroopers required to visit all the intersections in the town."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\n\n4 3\n3 4\n1 3\n2 3\n\n3 3\n1 3\n1 2\n2 3\n\n5 4\n1 2\n3 2\n2 4\n2 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 2\nCase 2: 1\nCase 3: 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"Dataset is huge, use faster I/O methods."}}]}