{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"The cows have been making movies lately, so they are ready to play a variant of the famous game \"Six Degrees of Kevin Bacon\".\r\u003cbr\u003e\r\u003cbr\u003eThe game works like this: each cow is considered to be zero degrees of separation (degrees) away from herself. If two distinct cows have been in a movie together, each is considered to be one \u0027degree\u0027 away from the other. If a two cows have never worked together but have both worked with a third cow, they are considered to be two \u0027degrees\u0027 away from each other (counted as: one degree to the cow they\u0027ve worked with and one more to the other cow). This scales to the general case.\r\u003cbr\u003e\r\u003cbr\u003eThe N (2 \u0026lt;\u003d N \u0026lt;\u003d 300) cows are interested in figuring out which cow has the smallest average degree of separation from all the other cows. excluding herself of course. The cows have made M (1 \u0026lt;\u003d M \u0026lt;\u003d 10000) movies and it is guaranteed that some relationship path exists between every pair of cows.\r\u003cbr\u003e"}},{"title":"Input","value":{"format":"HTML","content":"* Line 1: Two space-separated integers: N and M\r\u003cbr\u003e\r\u003cbr\u003e* Lines 2..M+1: Each input line contains a set of two or more space-separated integers that describes the cows appearing in a single movie. The first integer is the number of cows participating in the described movie, (e.g., Mi); the subsequent Mi integers tell which cows were.\r\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"* Line 1: A single integer that is 100 times the shortest mean degree of separation of any of the cows.\r\u003cbr\u003e"}},{"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\u003e4 2\r\n3 1 2 3\r\n2 3 4\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e100\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"[Cow 3 has worked with all the other cows and thus has degrees of separation: 1, 1, and 1 -- a mean of 1.00 .]\r\u003cbr\u003e"}}]}