문제
Problem 3: Crazy Fences [Brian Dean, 2012]
After visiting a modern art museum, Farmer John decides to re-design his farm by moving all of the N
FJ has C cows
PROBLEM NAME: crazy
입력
* Line 1: Two space-separated integers, N and C.
* Lines
* Lines
출력
* Line 1: The number of cows in the largest community.
예제1
7 3
0 0 10 0
10 0 10 5
12 5 10 5
10 5 1 5
12 5 12 7
0 7 12 7
0 7 0 0
3 4
6 6
17 3
2
INPUT DETAILS:
There are 7 fences and 3 cows.
OUTPUT DETAILS:
Cows #1 and #2 both belong to the same community, since they can visit each-other without touching any fences. Cow #3 cannot reach cow #1 or cow #2 without crossing a fence.