[b]p1.[/b] Twelve tables are set up in a row for a Millenium party. You want to put $2000$ cupcakes on the tables so that the numbers of cupcakes on adjacent tables always differ by one (for example, if the $5$th table has $20$ cupcakes, then the $4$th table has either $19$ or $21$ cupcakes, and the $6$th table has either $19$ or $21$ cupcakes).
a) Find a way to do this.
b) Suppose a Y2K bug eats one of the cupcakes, so you have only $1999$ cupcakes. Show that it is impossible to arrange the cupcakes on the tables according to the above conditions.


[b]p2.[/b] Let $P$ and $Q$ lie on the hypotenuse $AB$ of the right triangle $CAB$ so that $|AP|=|PQ|=|QB|=|AB|/3$. Suppose that $|CP|^2+|CQ|^2=5$. Prove that $|AB|$ has the same value for all such triangles, and find that value. Note: $|XY|$ denotes the length of the segment $XY$.


[b]p3.[/b] Let $P$ be a polynomial with integer coefficients and let $a, b, c$ be integers. Suppose $P(a)=b$, $P(b)=c$, and $P(c)=a$. Prove that $a=b=c$.


[b]p4.[/b] A lattice point is a point $(x,y)$ in the plane for which both $x$ and $y$ are integers. Each lattice point is painted with one of $1999$ available colors. Prove that there is a rectangle (of nonzero height and width) whose corners are lattice points of the same color.


[b]p5.[/b] A $1999$-by-$1999$ chocolate bar has vertical and horizontal grooves which divide it into $1999^2$ one-by-one squares. Caesar and Brutus are playing the following game with the chocolate bar: A move consists of a player picking up one chocolate rectangle; breaking it along a groove into two smaller rectangles; and then either putting both rectangles down or eating one piece and putting the other piece down. The players move alternately. The one who cannot make a move at his turn (because there are only one-by-one squares left) loses. Caesar starts. Which player has a winning strategy? Describe a winning strategy for that player.


PS. You should use hide for answers. Collected [url=https://artofproblemsolving.com/community/c5h2760506p24143309]here[/url].
To solve this problem, we will use coordinate geometry to find the value of \( |AB| \).

1. **Assign coordinates to points:**
   Let \( C = (0, 0) \), \( B = (3b, 0) \), and \( A = (0, 3a) \). This setup places \( C \) at the origin, \( B \) on the x-axis, and \( A \) on the y-axis.

2. **Determine coordinates of \( P \) and \( Q \):**
   Since \( |AP| = |PQ| = |QB| = \frac{|AB|}{3} \), we can place \( P \) and \( Q \) as follows:
   - \( P \) is one-third of the way from \( A \) to \( B \), so \( P = (b, 2a) \).
   - \( Q \) is two-thirds of the way from \( A \) to \( B \), so \( Q = (2b, a) \).

3. **Calculate distances \( |CP| \) and \( |CQ| \):**
   Using the distance formula, we find:
   \[
   |CP| = \sqrt{(b - 0)^2 + (2a - 0)^2} = \sqrt{b^2 + 4a^2}
   \]
   \[
   |CQ| = \sqrt{(2b - 0)^2 + (a - 0)^2} = \sqrt{4b^2 + a^2}
   \]

4. **Use the given condition \( |CP|^2 + |CQ|^2 = 5 \):**
   Substitute the distances into the given condition:
   \[
   (|CP|)^2 + (|CQ|)^2 = (b^2 + 4a^2) + (4b^2 + a^2) = 5
   \]
   Simplify the equation:
   \[
   b^2 + 4a^2 + 4b^2 + a^2 = 5
   \]
   \[
   5b^2 + 5a^2 = 5
   \]
   \[
   b^2 + a^2 = 1
   \]

5. **Calculate \( |AB| \):**
   The length of \( AB \) is given by:
   \[
   |AB| = \sqrt{(3b - 0)^2 + (0 - 3a)^2} = \sqrt{9b^2 + 9a^2}
   \]
   Substitute \( b^2 + a^2 = 1 \):
   \[
   |AB| = \sqrt{9(b^2 + a^2)} = \sqrt{9 \cdot 1} = \sqrt{9} = 3
   \]

Thus, the value of \( |AB| \) is always 3 for any right triangle \( CAB \) with the given conditions.

The final answer is \( \boxed{3} \)