<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="th">
	<id>http://158.108.32.49/wiki/index.php?action=history&amp;feed=atom&amp;title=Usaco2008</id>
	<title>Usaco2008 - ประวัติรุ่นแก้ไข</title>
	<link rel="self" type="application/atom+xml" href="http://158.108.32.49/wiki/index.php?action=history&amp;feed=atom&amp;title=Usaco2008"/>
	<link rel="alternate" type="text/html" href="http://158.108.32.49/wiki/index.php?title=Usaco2008&amp;action=history"/>
	<updated>2026-04-19T17:18:20Z</updated>
	<subtitle>ประวัติรุ่นแก้ไขของหน้านี้ในวิกิ</subtitle>
	<generator>MediaWiki 1.33.1</generator>
	<entry>
		<id>http://158.108.32.49/wiki/index.php?title=Usaco2008&amp;diff=55487&amp;oldid=prev</id>
		<title>Jittat เมื่อ 16:54, 11 กรกฎาคม 2558</title>
		<link rel="alternate" type="text/html" href="http://158.108.32.49/wiki/index.php?title=Usaco2008&amp;diff=55487&amp;oldid=prev"/>
		<updated>2015-07-11T16:54:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;th&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←รุ่นแก้ไขก่อนหน้า&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;รุ่นแก้ไขเมื่อ 16:54, 11 กรกฎาคม 2558&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot; &gt;แถว 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;แถว 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== OPEN08 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== OPEN08 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Source for test cases and analysis: [http://contest.usaco.org/OPEN08.htm]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Problem 1: The Ultimate Battle [Christos Tzamos, 2007] ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Problem 1: The Ultimate Battle [Christos Tzamos, 2007] ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jittat</name></author>
		
	</entry>
	<entry>
		<id>http://158.108.32.49/wiki/index.php?title=Usaco2008&amp;diff=55486&amp;oldid=prev</id>
		<title>Jittat: หน้าที่ถูกสร้างด้วย &#039;Mirrored from [http://tjsct.wikidot.com/usaco-open09-gold].  Source from the old [http://www.usaco.org/ USACO] website is currently una...&#039;</title>
		<link rel="alternate" type="text/html" href="http://158.108.32.49/wiki/index.php?title=Usaco2008&amp;diff=55486&amp;oldid=prev"/>
		<updated>2015-07-11T16:53:35Z</updated>

		<summary type="html">&lt;p&gt;หน้าที่ถูกสร้างด้วย &amp;#039;Mirrored from [http://tjsct.wikidot.com/usaco-open09-gold].  Source from the old [http://www.usaco.org/ USACO] website is currently una...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;หน้าใหม่&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Mirrored from [http://tjsct.wikidot.com/usaco-open09-gold].  Source from the old [http://www.usaco.org/ USACO] website is currently unavailable.&lt;br /&gt;
&lt;br /&gt;
== OPEN08 ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The Ultimate Battle [Christos Tzamos, 2007] ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bessie and Canmuu are battling each other on a rectagular W x H (1&lt;br /&gt;
&amp;lt;= W &amp;lt;= 5,000; 1 &amp;lt;= H &amp;lt;= 5,000) field. Bessie is initially&lt;br /&gt;
positioned at coordinates (x1,y1) (1 &amp;lt;= x1 &amp;lt;= W; 1 &amp;lt;= y1 &amp;lt;= H);&lt;br /&gt;
Canmuu is positioned in different row and column at coordinates&lt;br /&gt;
(x2,y2) (1 &amp;lt;= x2 &amp;lt;= W; 1 &amp;lt;= y2 &amp;lt;= H; x1 != x2; y1 != y2). The&lt;br /&gt;
Ultimate Battle&amp;#039;s winner is the first player who plasters the other&lt;br /&gt;
with a pie in the face.&lt;br /&gt;
&lt;br /&gt;
While both players can see each other at all times, they can only&lt;br /&gt;
plaster their opponent with a pie in the face when the opponent&lt;br /&gt;
passes through (or stops on) the row or column occupied by the&lt;br /&gt;
pie-thrower.&lt;br /&gt;
&lt;br /&gt;
Bessie starts first and they alternate turns. During each turn, a&lt;br /&gt;
player can move as many steps in any one of the four rectilinear&lt;br /&gt;
directions (up, down, left, right) as they wish -- without exceeding&lt;br /&gt;
the limits of the yard, of course.&lt;br /&gt;
&lt;br /&gt;
Bessie asks for your help to beat Canmuu. Write a program to tell&lt;br /&gt;
her where to move for each of her turns.&lt;br /&gt;
&lt;br /&gt;
This task is &amp;quot;interactive&amp;quot;. Your program must first read six integers&lt;br /&gt;
from the input file and then interact with the grader as follows:&lt;br /&gt;
&lt;br /&gt;
   At each of Bessie&amp;#039;s turns, the program calculates and outputs&lt;br /&gt;
   the Bessie&amp;#039;s new location. The new location must be a valid move,&lt;br /&gt;
   i.e., Bessie&amp;#039;s new coordinate must differ from old one either&lt;br /&gt;
   in the x or y coordinate but not both. If she moves through one&lt;br /&gt;
   of Canmuu&amp;#039;s x or y coordinates, the game terminates automatically&lt;br /&gt;
   with a moose victory (and a &amp;quot;wrong answer&amp;quot; for you).&lt;br /&gt;
&lt;br /&gt;
   If Canmuu cannot make a move without losing, the grader will&lt;br /&gt;
   terminate your program automatically and award Bessie the victory.&lt;br /&gt;
   Otherwise, your program should read in Canmuu&amp;#039;s move in two&lt;br /&gt;
   integers, the new coordinates of the methodical moose.&lt;br /&gt;
&lt;br /&gt;
You may assume that Bessie will always start in a situation where a&lt;br /&gt;
victory is possible. You may also assume that Canmuu is no fool.&lt;br /&gt;
&lt;br /&gt;
NOTE: Read the six integers from file pieface.in; read Canmuu&amp;#039;s&lt;br /&gt;
moves from the standard input (i.e., console).&lt;br /&gt;
&lt;br /&gt;
---------------- Reactive Programs ----------------------&lt;br /&gt;
&lt;br /&gt;
In order to ensure that your program&amp;#039;s output is not buffered inside&lt;br /&gt;
your program; you must &amp;#039;flush&amp;#039; your output.&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re using stdio.h, include the line&lt;br /&gt;
&lt;br /&gt;
       setbuf(stdout, 0);&lt;br /&gt;
&lt;br /&gt;
near the top of your program.&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re using C++ style I/O, flush each output line like this:&lt;br /&gt;
&lt;br /&gt;
cout &amp;lt;&amp;lt; line &amp;lt;&amp;lt; &amp;quot;\n&amp;quot; &amp;lt;&amp;lt; flush;&lt;br /&gt;
&lt;br /&gt;
For Pascal, add the following statement after each writeln statement:&lt;br /&gt;
&lt;br /&gt;
flush(stdout);&lt;br /&gt;
&lt;br /&gt;
For Java, add the following after each output statement:&lt;br /&gt;
&lt;br /&gt;
    System.out.flush();&lt;br /&gt;
&lt;br /&gt;
If your program &amp;#039;times out&amp;#039; after you wrote a reply, it probably&lt;br /&gt;
is not properly flushing the output.&lt;br /&gt;
&lt;br /&gt;
---------------- JAVA USERS ----------------------&lt;br /&gt;
&lt;br /&gt;
Here is (we hope) the skeleton of input/output statements you will&lt;br /&gt;
need:&lt;br /&gt;
&lt;br /&gt;
import java.io.*;&lt;br /&gt;
import java.util.*;&lt;br /&gt;
&lt;br /&gt;
public class pieface {&lt;br /&gt;
    public static void main(String[] args) throws IOException {&lt;br /&gt;
        BufferedReader in = new BufferedReader(new&lt;br /&gt;
                                          InputStreamReader(System.in));&lt;br /&gt;
    /* write ... */&lt;br /&gt;
        System.out.println(...);&lt;br /&gt;
        System.out.flush();&lt;br /&gt;
&lt;br /&gt;
    /* read a reply */&lt;br /&gt;
        response = in.readLine();&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
PROBLEM NAME: pieface&lt;br /&gt;
&lt;br /&gt;
INPUT FORMAT:&lt;br /&gt;
&lt;br /&gt;
* Line 1: Six space-separated integers: W, H, x1, y1, x2, and y2&lt;br /&gt;
&lt;br /&gt;
SAMPLE INPUT (file pieface.in):&lt;br /&gt;
&lt;br /&gt;
3 3 1 1 2 3&lt;br /&gt;
&lt;br /&gt;
OUTPUT FORMAT:&lt;br /&gt;
&lt;br /&gt;
* Line All: Each output line contains a pair of space-separated&lt;br /&gt;
        integers that represent Bessie&amp;#039;s new location.&lt;br /&gt;
&lt;br /&gt;
SAMPLE OUTPUT (file pieface.out):&lt;br /&gt;
&lt;br /&gt;
Do not use the file &amp;#039;pieface.out&amp;#039;. See below for sample interactions.&lt;br /&gt;
&lt;br /&gt;
OUTPUT DETAILS:&lt;br /&gt;
&lt;br /&gt;
Here is a possible winning interaction:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; 1 2       Bessie moves up by 1 to 1,2&lt;br /&gt;
&amp;lt; 3 3       Canmuu moves to 1 to the right to 3,3&lt;br /&gt;
&amp;gt; 2 2       Bessie moves to 2,2 by going one to the right&lt;br /&gt;
At which point Canmuu could no longer make a move without getting&lt;br /&gt;
a pie in the face.&lt;br /&gt;
&lt;br /&gt;
3 . C .      . C .       . . C      . . C&lt;br /&gt;
2 . . .  =&amp;gt;  B . .  =&amp;gt;   B . .  =&amp;gt;  . B . =&amp;gt; Canmuu must pass Bessie&amp;#039;s row&lt;br /&gt;
1 B . .      . . .       . . .      . . .    or column on his next move&lt;br /&gt;
  1 2 3      1 2 3       1 2 3      1 2 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Crisis on the Farm [Thomas Williamson, 2004] ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Farmer John and his herd of exotic dancing bovines have been&lt;br /&gt;
practicing for his new moosical, &amp;quot;The Street Cow Named Desire&amp;quot;. At&lt;br /&gt;
one point in the middle of rehearsal, his cows are stacked on top&lt;br /&gt;
of each other in N (1 &amp;lt;= N &amp;lt;= 1,000) sets of 30, one cow standing&lt;br /&gt;
on the back of the other (they are quite amazing cows). Thus, the&lt;br /&gt;
pasture is dotted with both these stacks of 30 cows and also, in&lt;br /&gt;
separate locations, M (1 &amp;lt;= M &amp;lt;= 1,000) haystacks. Below is a sample&lt;br /&gt;
of one way they might be laid out:&lt;br /&gt;
&lt;br /&gt;
                8 .........&lt;br /&gt;
                7 ....CH.H.         C = stack of 30 cows&lt;br /&gt;
                6 .........&lt;br /&gt;
                5 .........         H = haystack&lt;br /&gt;
                4 ..C.HH...&lt;br /&gt;
                3 .........&lt;br /&gt;
                2 .....C.HH&lt;br /&gt;
                1 .........&lt;br /&gt;
                  123456789&lt;br /&gt;
&lt;br /&gt;
As the musical&amp;#039;s conductor, Farmer John has four whistles with&lt;br /&gt;
various tones. One whistle commands the cow at the bottom of each&lt;br /&gt;
stack to move (along with all the stacked cows) one unit north,&lt;br /&gt;
another indicates a move to the south, one indicates a move to the&lt;br /&gt;
east, and a fourth to order a move to the west.&lt;br /&gt;
&lt;br /&gt;
Any time the stack of cows enters a grid location with a haystack,&lt;br /&gt;
the cow on the top of the stack (even if the stack has height one)&lt;br /&gt;
will jump onto the haystack while the remaining cows move into the&lt;br /&gt;
same location as the haystack. Thus, if the bottom cow encounters&lt;br /&gt;
30 haystacks (perhaps different haystacks, perhaps not), the stack&lt;br /&gt;
of 30 cows is exhausted with all the cows standing on top of haystacks&lt;br /&gt;
(or standing on cows on haystacks). The sturdy haystacks can each&lt;br /&gt;
support an unlimited number of cows.&lt;br /&gt;
&lt;br /&gt;
Farmer John glances across his pasture to Farmer Don&amp;#039;s milking&lt;br /&gt;
facility to see, to his horror, a huge milk tank exploding and&lt;br /&gt;
unleashing a giant tidal wave of milk making its way toward the&lt;br /&gt;
performing cows! Since any cows on a haystack are safe, FJ must now&lt;br /&gt;
do what he can to save the lives of as many cows as possible using&lt;br /&gt;
what has turned from a simple dance routine into a lifesaving&lt;br /&gt;
technique.&lt;br /&gt;
&lt;br /&gt;
Given the number of times K (1 &amp;lt;= K &amp;lt;= 30) farmer John can blow a&lt;br /&gt;
whistle until the wave of milk crashes over the pasture and also&lt;br /&gt;
the X_i, Y_i positions (1 &amp;lt;= X_i &amp;lt;= 1,000; 1 &amp;lt;= Y_i &amp;lt;= 1,000) of&lt;br /&gt;
the N stacks of cows and M haystacks (none of which currently has&lt;br /&gt;
any cows on it), report the greatest number of cows that can be&lt;br /&gt;
saved and find a sequence of whistle blows that does the job. The&lt;br /&gt;
sequence should be reported in terms of the four directions, &amp;#039;E&amp;#039;&lt;br /&gt;
for east, &amp;#039;N&amp;#039; for north, &amp;#039;W&amp;#039; for west, &amp;#039;S&amp;#039; for south.  Among all&lt;br /&gt;
such sequences, farmer John wants the lexicographically least.&lt;br /&gt;
Initial locations of cows and haystacks will not share the same&lt;br /&gt;
coordinates in the input file.&lt;br /&gt;
&lt;br /&gt;
Cows can be moved to any location, including ones outside the&lt;br /&gt;
pasture.&lt;br /&gt;
&lt;br /&gt;
PROBLEM NAME: crisis&lt;br /&gt;
&lt;br /&gt;
INPUT FORMAT:&lt;br /&gt;
&lt;br /&gt;
* Line 1: Three space-separated integers: N, M, and K&lt;br /&gt;
&lt;br /&gt;
* Lines 2..N+1: Line i+1 describes the X,Y location of a stack of 30&lt;br /&gt;
        cows using two space-separated integers: X_i and Y_i&lt;br /&gt;
&lt;br /&gt;
* Lines N+2..N+M+1: Line i+N+1 describes the X,Y location of a&lt;br /&gt;
        haystack using two space-separated integers: X_i and Y_i&lt;br /&gt;
&lt;br /&gt;
SAMPLE INPUT (file crisis.in):&lt;br /&gt;
&lt;br /&gt;
3 6 3&lt;br /&gt;
3 4&lt;br /&gt;
6 2&lt;br /&gt;
5 7&lt;br /&gt;
8 2&lt;br /&gt;
9 2&lt;br /&gt;
6 4&lt;br /&gt;
5 4&lt;br /&gt;
6 7&lt;br /&gt;
8 7&lt;br /&gt;
&lt;br /&gt;
OUTPUT FORMAT:&lt;br /&gt;
&lt;br /&gt;
* Line 1: A single integer that is the most number of cows that can be&lt;br /&gt;
        saved.&lt;br /&gt;
&lt;br /&gt;
* Line 2: K characters, the lexicographically least sequence of&lt;br /&gt;
        commands FJ should issue to maximize the number of cows saved.&lt;br /&gt;
&lt;br /&gt;
SAMPLE OUTPUT (file crisis.out):&lt;br /&gt;
&lt;br /&gt;
6&lt;br /&gt;
EEE&lt;br /&gt;
&lt;br /&gt;
OUTPUT DETAILS:&lt;br /&gt;
&lt;br /&gt;
Use the &amp;#039;east&amp;#039; whistle three times, at which point the milk floods&lt;br /&gt;
the area.  Each haystack ends up saving 1 cow.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: Cow Neighborhoods [Richard Ho, 2006] ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Those Who Know About Cows are aware of the way cows group into &amp;quot;Cow&lt;br /&gt;
Neighborhoods&amp;quot;. They have observed Farmer John&amp;#039;s N (1 &amp;lt;= N &amp;lt;=&lt;br /&gt;
100,000) cows (conveniently numbered 1..N) as they graze, each at&lt;br /&gt;
her own unique integer rectilinear coordinate, on a pasture whose&lt;br /&gt;
X and Y coordinates are in the range 1..1,000,000,000.&lt;br /&gt;
&lt;br /&gt;
Two cows are neighbors if at least one of two criteria is met:&lt;br /&gt;
&lt;br /&gt;
  1) If the cows are no further than some integer Manhattan distance&lt;br /&gt;
     C (1 &amp;lt;= C &amp;lt;= 1,000,000,000) apart, they are neighbors. [Manhattan&lt;br /&gt;
     distance is calculated as d = |x1-x2| + |y1-y2|.]&lt;br /&gt;
&lt;br /&gt;
  2) If cow A is a neighbor of cow Z and cow B is a neighbor of cow&lt;br /&gt;
     Z, then cow A is a neighbor of cow B (the &amp;quot;transitive closure&lt;br /&gt;
     of neighbors&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Given the locations of the cows and the distance C, determine the&lt;br /&gt;
the number of neighborhoods and the number of cows in the largest&lt;br /&gt;
neighborhood.&lt;br /&gt;
&lt;br /&gt;
By way of example, consider the pasture below. When C = 4, this&lt;br /&gt;
pasture has four neighborhoods: a big one on the left, two neighborhoods&lt;br /&gt;
of size 1 (the lonesome cows), and a huge neighborhood on the right&lt;br /&gt;
with 60 different cows.&lt;br /&gt;
&lt;br /&gt;
.....................................*.................&lt;br /&gt;
....*...*..*.......................***.................&lt;br /&gt;
......*...........................****.................&lt;br /&gt;
..*....*..*.......................*...*.******.*.*.....&lt;br /&gt;
........................*.............***...***...*....&lt;br /&gt;
*..*..*...*..........................*..*...*..*...*...&lt;br /&gt;
.....................................*..*...*..*.......&lt;br /&gt;
.....................................*..*...*..*.......&lt;br /&gt;
...*................*..................................&lt;br /&gt;
.*..*............................*.*.*.*.*.*.*.*.*.*.*.&lt;br /&gt;
.*.....*..........................*.*.*.*.*.*.*.*.*.*.*&lt;br /&gt;
....*..................................................&lt;br /&gt;
&lt;br /&gt;
The input file describes cow locations by integer X,Y coordinates,&lt;br /&gt;
where the lower left corner is (1,1) and cows close to that corner&lt;br /&gt;
appear at both (2,2) and (5,1) in the example above.&lt;br /&gt;
&lt;br /&gt;
For a given pasture, determine both the number of cow neighborhoods&lt;br /&gt;
and the number of cows resident in the largest cow neighborhood.&lt;br /&gt;
&lt;br /&gt;
The above picture is sample test case 2, which will be evaluated&lt;br /&gt;
for you upon submission.&lt;br /&gt;
&lt;br /&gt;
Partial feedback for some test cases will be provided on the first&lt;br /&gt;
10 submissions.&lt;br /&gt;
&lt;br /&gt;
Time Limit: 2 seconds&lt;br /&gt;
&lt;br /&gt;
Memory Limit: 32MB&lt;br /&gt;
&lt;br /&gt;
PROBLEM NAME: nabor&lt;br /&gt;
&lt;br /&gt;
INPUT FORMAT:&lt;br /&gt;
&lt;br /&gt;
* Line 1: Two space-separated integers: N and C&lt;br /&gt;
&lt;br /&gt;
* Lines 2..N+1: Line i+1 describes cow i&amp;#039;s location with two&lt;br /&gt;
        space-separated integers: X_i and Y_i&lt;br /&gt;
&lt;br /&gt;
SAMPLE INPUT (file nabor.in):&lt;br /&gt;
&lt;br /&gt;
4 2&lt;br /&gt;
1 1&lt;br /&gt;
3 3&lt;br /&gt;
2 2&lt;br /&gt;
10 10&lt;br /&gt;
&lt;br /&gt;
OUTPUT FORMAT:&lt;br /&gt;
&lt;br /&gt;
* Line 1: A single line with a two space-separated integers: the&lt;br /&gt;
        number of cow neighborhoods and the size of the largest cow&lt;br /&gt;
        neighborhood.&lt;br /&gt;
&lt;br /&gt;
SAMPLE OUTPUT (file nabor.out):&lt;br /&gt;
&lt;br /&gt;
2 3&lt;br /&gt;
&lt;br /&gt;
OUTPUT DETAILS:&lt;br /&gt;
&lt;br /&gt;
There are 2 neighborhoods, one formed by the first three cows and&lt;br /&gt;
the other being the last cow. The largest neighborhood therefore&lt;br /&gt;
has size 3.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jittat</name></author>
		
	</entry>
</feed>