Navvye/Olympiad-Problems-CSV huggingface dataset:
Problem: Let $N = \sum_{k = 1}^{1000} k ( \lceil \log_{\sqrt{2}} k \rceil  - \lfloor \log_{\sqrt{2}} k \rfloor )$
Find the remainder when $N$ is divided by 1000.  ( $\lfloor{k}\rfloor$ is the greatest integer less than or equal to $k$ , and $\lceil{k}\rceil$ is the least integer greater than or equal to $k$ .)

Solution: The ceiling of a number minus the floor of a number is either equal to zero (if the number is an integer ); otherwise, it is equal to 1. Thus, we need to find when or not $\log_{\sqrt{2}} k$ is an integer.
The change of base formula shows that $\frac{\log k}{\log \sqrt{2}} = \frac{2 \log k}{\log 2}$ . For the $\log 2$ term to cancel out, $k$ is a power of $2$ . Thus, $N$ is equal to the sum of all the numbers from 1 to 1000, excluding all powers of 2 from $2^0 = 1$ to $2^9 = 512$
The formula for the sum of an arithmetic sequence and the sum of a geometric sequence yields that our answer is $\left[\frac{(1000 + 1)(1000)}{2} - (1 + 2 + 2^2 + \ldots + 2^9)\right] \mod{1000}$
Simplifying, we get $\left[1000\left(\frac{1000+1}{2}\right) -1023\right] \mod{1000} \equiv [500-23] \mod{1000} \equiv 477 \mod{1000}.$ The answer is $\boxed{477}$

Answer:  477
Problem: The polynomial $P(x)$ is cubic .  What is the largest value of $k$ for which the polynomials $Q_1(x) = x^2 + (k-29)x - k$ and $Q_2(x) = 2x^2+ (2k-43)x + k$ are both factors of $P(x)$

Solution: We can see that $Q_1$ and $Q_2$ must have a root in common for them to both be factors of the same cubic.
Let this root be $a$
We then know that $a$ is a root of $Q_{2}(x)-2Q_{1}(x) = 2x^{2}+2kx-43x+k-2x^{2}-2kx+58x+2k = 15x+3k = 0$ , so $x = \frac{-k}{5}$
We then know that $\frac{-k}{5}$ is a root of $Q_{1}$ so we get: $\frac{k^{2}}{25}+(k-29)\left(\frac{-k}{5}\right)-k = 0 = k^{2}-5(k-29)(k)-25k = k^{2}-5k^{2}+145k-25k$ or $k^{2}=30k$ , so $k=30$ is the highest.
We can trivially check into the original equations to find that $k=30$ produces a root in common, so the answer is $\boxed{030}$

Answer:  030
Problem: The polynomial $P(x)$ is cubic .  What is the largest value of $k$ for which the polynomials $Q_1(x) = x^2 + (k-29)x - k$ and $Q_2(x) = 2x^2+ (2k-43)x + k$ are both factors of $P(x)$

Solution: Again, let the common root be $a$ ; let the other two roots be $m$ and $n$ . We can write that $(x - a)(x - m) = x^2 + (k - 29)x - k$ and that $2(x - a)(x - n) = 2\left(x^2 + \left(k - \frac{43}{2}\right)x + \frac{k}{2}\right)$
Therefore, we can write four equations (and we have four variables ), $a + m = 29 - k$ $a + n = \frac{43}{2} - k$ $am = -k$ , and $an = \frac{k}{2}$
The first two equations show that $m - n = 29 - \frac{43}{2} = \frac{15}{2}$ . The last two equations show that $\frac{m}{n} = -2$ . Solving these show that $m = 5$ and that $n = -\frac{5}{2}$ . Substituting back into the equations, we eventually find that $k = \boxed{030}$

Answer:  030
Problem: The polynomial $P(x)$ is cubic .  What is the largest value of $k$ for which the polynomials $Q_1(x) = x^2 + (k-29)x - k$ and $Q_2(x) = 2x^2+ (2k-43)x + k$ are both factors of $P(x)$

Solution: Since $Q_1(x)$ and $Q_2(x)$ are both factors of $P(x)$ , which is cubic, we know the other factors associated with each of $Q_1(x)$ and $Q_2(x)$ must be linear. Let $Q_1(x)R(x) = Q_2(x)S(x) = P(x)$ , where $R(x) = ax + b$ and $S(x) = cx + d$ . Then we have that $((x^2 + (k-29)x - k))(ax + b) = ((2x^2+ (2k-43)x + k))(cx + d)$ . Equating coefficients, we get the following system of equations:
\begin{align}  a = 2c \\ b = -d \\ 2c(k - 29) - d = c(2k - 43) + 2d \\ -d(k - 29) - 2ck = d(2k - 43) + ck  \end{align}
Using equations $(1)$ and $(2)$ to make substitutions into equation $(3)$ , we see that the $k$ 's drop out and we're left with $d = -5c$ . Substituting this expression for $d$ into equation $(4)$ and solving, we see that $k$ must be $\boxed{030}$

Answer:  030
Problem: The polynomial $P(x)$ is cubic .  What is the largest value of $k$ for which the polynomials $Q_1(x) = x^2 + (k-29)x - k$ and $Q_2(x) = 2x^2+ (2k-43)x + k$ are both factors of $P(x)$

Solution: Notice that if the roots of $Q_1(x)$ and $Q_2(x)$ are all distinct, then $P(x)$ would have four distinct roots, which is a contradiction since it's cubic. Thus, $Q_1(x)$ and $Q_2(x)$ must share a root. Let this common value be $r.$
Thus, we see that we have \[r^2 + (k - 29)r - k = 0,\] \[2r^2 + (2k - 43)r + k = 0.\] Adding the two equations gives us \[3r^2 + (3k - 72)r = 0 \implies r = 0, 24 - k.\] Now, we have two cases to consider. If $r = 0,$ then we have that $Q_1(r) = 0 = r^2 + (k - 29)r - k \implies k = 0.$ On the other hand, if $r = 24 - k,$ we see that \[Q_1(r) = 0 = (24 - k)^2 + (k - 29)(24 - k) - k \implies k = \boxed{030}.\] This can easily be checked to see that it does indeed work, and we're done!

Answer:  030
Problem: In right triangle $ABC$ with right angle $C$ $CA = 30$ and $CB = 16$ .  Its legs $CA$ and $CB$ are extended beyond $A$ and $B$ Points $O_1$ and $O_2$ lie in the exterior of the triangle and are the centers of two circles with equal radii .  The circle with center $O_1$ is tangent to the hypotenuse and to the extension of leg $CA$ , the circle with center $O_2$ is tangent to the hypotenuse and to the extension of leg $CB$ , and the circles are externally tangent to each other.  The length of the radius either circle can be expressed as $p/q$ , where $p$ and $q$ are relatively prime positive integers .  Find $p+q$

Solution: A different approach is to plot the triangle on the Cartesian Plane with $C$ at $(0,0)$ $A$ at $(0,30)$ , and $B$ at $(16,0)$ . We wish to find the coordinates of $O_1$ and $O_2$ in terms of the radius, which will be expressed as $r$ in the rest of this solution. When we know the coordinates, we will set the distance between the 2 points equal to $2r$ . All points $r$ units away from $\overline{AB}$ are on the line with slope $-\frac{15}{8}$ , and y-intercept $30+ \frac{17}{8} r$
$O_1$ will have x-coordinate $r$ and likewise $O_2$ will have y-coordinate $r$ plugging this into the equation for the line mentioned in the sentence above gives us:
$O_1 = \left(r,\frac14 r+30\right)$ and $O_2 = \left(\frac35 r+16,r\right)$
By the distance formula and the fact that the circles and tangent, we have: $\left(16-\frac25 r\right)^2 + \left(30-\frac34 r\right)^2 = (2r)^2$
which simplifies into the quadratic equation: $1311 r^2 + 23120 r - 462400 = 0$
And by the quadratic equation, the solutions are: $\frac{-23120 \pm 54400}{2622}$ The solution including the " $-$ " is extraneous so we have the radius equal to $\frac{31280}{2622}$
Which simplifies to $\frac{680}{57}$ . The sum of the numerator and the denominator is $\boxed{737}$

Answer:  737
Problem: In right triangle $ABC$ with right angle $C$ $CA = 30$ and $CB = 16$ .  Its legs $CA$ and $CB$ are extended beyond $A$ and $B$ Points $O_1$ and $O_2$ lie in the exterior of the triangle and are the centers of two circles with equal radii .  The circle with center $O_1$ is tangent to the hypotenuse and to the extension of leg $CA$ , the circle with center $O_2$ is tangent to the hypotenuse and to the extension of leg $CB$ , and the circles are externally tangent to each other.  The length of the radius either circle can be expressed as $p/q$ , where $p$ and $q$ are relatively prime positive integers .  Find $p+q$

Solution: It is known that $O_1O_2$ is parallel to AB. Thus, extending $O_1F$ and $GO_2$ to intersect at H yields similar triangles $O_1O_2H$ and BAC, so that $O_1O_2 = 2r$ $O_1H = \frac{16r}{17}$ , and $HO_2 = \frac{30r}{17}$ . It should be noted that $O_2G = r$ . Also, FHGC is a rectangle, and so AF = $\frac{47r}{17} - 30$ and similarly for BG. Because tangents to a circle are equal, the hypotenuse can be expressed in terms of r: \[2r + \frac{47r}{17} - 30 + \frac{33r}{17} - 16 = 34\] Thus, r = $\frac{680}{57}$ , and the answer is $\boxed{737}.$

Answer:  737
Problem: In right triangle $ABC$ with right angle $C$ $CA = 30$ and $CB = 16$ .  Its legs $CA$ and $CB$ are extended beyond $A$ and $B$ Points $O_1$ and $O_2$ lie in the exterior of the triangle and are the centers of two circles with equal radii .  The circle with center $O_1$ is tangent to the hypotenuse and to the extension of leg $CA$ , the circle with center $O_2$ is tangent to the hypotenuse and to the extension of leg $CB$ , and the circles are externally tangent to each other.  The length of the radius either circle can be expressed as $p/q$ , where $p$ and $q$ are relatively prime positive integers .  Find $p+q$

Solution: Let the radius of the circle be $r$ . It can be seen that $\Delta FHO_{1}$ and $\Delta O_{2}GJ$ are similar to $\Delta ACB$ , and the length of the hypotenuses are $\frac{17}{8}r$ and $\frac {17}{15}r$ , respectively. Then, the entire length of $HJ$ is going to be $(\frac{17}{8}+\frac{17}{15}+2)r = \frac{631}{120}r$ . The length of the hypotenuse of $\Delta ACB$ is 34, so the length of the height to $AB$ is $\frac{16*30}{34} = \frac{240}{17}$ . Thus, the height to $\Delta HCJ$ is going to be $\frac{240}{17} + r$ $\Delta HCJ$ is similar to $\Delta ACB$ so we have the following: $\frac{\frac{631}{120}r}{34} = \frac{\frac{240}{17} + r}{\frac{240}{17}}$ . Cross multiplying and simplifying, we get that $r = \frac{680}{57}$ so the answer is $\boxed{737}$ .
~Leonard_my_dude~

Answer:  737
Problem: In a 6 x 4 grid (6 rows, 4 columns), 12 of the 24 squares are to be shaded so that there are two shaded squares in each row and three shaded squares in each column.  Let $N$ be the number of shadings with this property.  Find the remainder when $N$ is divided by 1000.
AIME I 2007-10.png

Solution: Consider the first column.  There are ${6\choose3} = 20$ ways that the rows could be chosen, but without loss of generality let them be the first three rows.  (Change the order of the rows to make this true.)  We will multiply whatever answer we get by 20 to get our final answer.
Now consider the 3x3 that is next to the 3 boxes we have filled in.  We must put one ball in each row (since there must be 2 balls in each row and we've already put one in each).  We split into three cases:
So there are $20(3+54+36) = 1860$ different shadings, and the solution is $\boxed{860}$

Answer:  860
Problem: In a 6 x 4 grid (6 rows, 4 columns), 12 of the 24 squares are to be shaded so that there are two shaded squares in each row and three shaded squares in each column.  Let $N$ be the number of shadings with this property.  Find the remainder when $N$ is divided by 1000.
AIME I 2007-10.png

Solution: We start by showing that every group of $6$ rows can be grouped into $3$ complementary pairs.
We proceed with proof by contradiction. Without loss of generality, assume that the first row has columns $1$ and $2$ shaded. Note how if there is no complement to this, then all the other five rows must have at least one square in the first two columns shaded. That means that in total, the first two rows have $2+5=7$ squares shaded in- that is false since it should only be $6$ .
Thus, there exists another row that is complementary to the first. We remove those two and use a similar argument again to show that every group of $6$ rows can be grouped into $3$ complementary pairs.
Now we proceed with three cases.
Our answer is thus $720+1080+60=1860,$ leaving us with a final answer of $\boxed{860}.$

Answer:  860
Problem: In a 6 x 4 grid (6 rows, 4 columns), 12 of the 24 squares are to be shaded so that there are two shaded squares in each row and three shaded squares in each column.  Let $N$ be the number of shadings with this property.  Find the remainder when $N$ is divided by 1000.
AIME I 2007-10.png

Solution: Note that if we find a valid shading of the first 3 columns, the shading of the last column is determined. We also note that within the first 3 columns, there will be 3 rows with 1 shaded square and 3 rows with 2 shaded squares.
There are ${6 \choose 3}$ ways to choose which rows have 1 shaded square (which we'll call a "1-row") within the first 3 columns and which rows have 2 (we'll call these "2-rows") within the first 3 columns. Next, we do some casework:
In total, we have ${6\choose3}(1+18+54+20)=20*93=1860$ . Thus our answer is $\boxed{860}$

Answer:  860
Problem: In a 6 x 4 grid (6 rows, 4 columns), 12 of the 24 squares are to be shaded so that there are two shaded squares in each row and three shaded squares in each column.  Let $N$ be the number of shadings with this property.  Find the remainder when $N$ is divided by 1000.
AIME I 2007-10.png

Solution: We can use generating functions. Suppose that the variables $a$ $b$ $c$ , and $d$ represent shading a square that appears in the first, second, third, or fourth columns, respectively. Then if two squares in the row are shaded, then the row is represented by the generating function $ab+ac+ad+bc+bd+cd$ , which we can write as $P(a,b,c,d)=(ab+cd)+(a+b)(c+d)$ . Therefore, $P(a,b,c,d)^6$ represents all of the possible ways to color six rows such that each row has two shaded squares. We only want the possibilities when each column has three shaded squares, or rather, the coefficient of $a^3b^3c^3d^3$ in $P(a,b,c,d)^6$
By the Binomial Theorem, \[P(a,b,c,d)^6=\sum_{k=0}^6 \binom{6}{k} (ab+cd)^k(a+b)^{6-k}(c+d)^{6-k}.\tag{1}\] If we expand $(ab+cd)^k$ , then the powers of $a$ and $b$ are always equal. Therefore, to obtain terms of the form $a^3b^3c^3d^3$ , the powers of $a$ and $b$ in $(a+b)^{6-k}$ must be equal. In particular, only the central term in the binomial expansion will contribute, and this implies that $k$ must be even. We can use the same logic for $c$ and $d$ . Therefore, the coefficient of $a^3b^3c^3d^3$ in the following expression is the same as the coefficient of $a^3b^3c^3d^3$ in (1). \[\sum_{k=0}^3 \binom{6}{2k} (ab+cd)^{2k}(ab)^{3-k}(cd)^{3-k}\binom{6-2k}{3-k}^2.\tag{2}\] Now we notice that the only way to obtain terms of the form $a^3b^3c^3d^3$ is if we take the central term in the binomial expansion of $(ab+cd)^{2k}$ . Therefore, the terms that contribute to the coefficient of $a^3b^3c^3d^3$ in (2) are \[\sum_{k=0}^3 \binom{6}{2k}\binom{2k}{k}\binom{6-2k}{3-k}^2(abcd)^3.\] This sum is $400+1080+360+20=1860$ so the answer is $\boxed{860}$

Answer:  860
Problem: For each positive integer $p$ , let $b(p)$ denote the unique positive integer $k$ such that $|k-\sqrt{p}| < \frac{1}{2}$ .  For example, $b(6) = 2$ and $b(23) = 5$ .  If $S = \sum_{p=1}^{2007} b(p),$ find the remainder when $S$ is divided by 1000.

Solution: $\left(k- \frac 12\right)^2=k^2-k+\frac 14$ and $\left(k+ \frac 12\right)^2=k^2+k+ \frac 14$ . Therefore $b(p)=k$ if and only if $p$ is in this range, or $k^2-k<p\leq k^2+k$ . There are $2k$ numbers in this range, so the sum of $b(p)$ over this range is $(2k)k=2k^2$ $44<\sqrt{2007}<45$ , so all numbers $1$ to $44$ have their full range. Summing this up with the formula for the sum of the first $n$ squares ( $\frac{n(n+1)(2n+1)}{6}$ ), we get $\sum_{k=1}^{44}2k^2=2\frac{44(44+1)(2*44+1)}{6}=58740$ . We need only consider the $740$ because we are working with modulo $1000$
Now consider the range of numbers such that $b(p)=45$ . These numbers are $\left\lceil\frac{44^2 + 45^2}{2}\right\rceil = 1981$ to $2007$ . There are $2007 - 1981 + 1 = 27$ (1 to be inclusive) of them. $27*45=1215$ , and $215+740= \boxed{955}$ , the answer.

Answer:  955
Problem: For each positive integer $p$ , let $b(p)$ denote the unique positive integer $k$ such that $|k-\sqrt{p}| < \frac{1}{2}$ .  For example, $b(6) = 2$ and $b(23) = 5$ .  If $S = \sum_{p=1}^{2007} b(p),$ find the remainder when $S$ is divided by 1000.

Solution: Let $p$ be in the range of $a^2 \le p < (a+1)^2$ . Then, we need to find the point where the value of $b(p)$ flips from $k$ to $k+1$ . This will happen when $p$ exceeds $(a+\frac{1}{2})^2$ or $a(a+1)+\frac{1}{4}$ . Thus, if $a^2 \le p \le a(a+1)$ then $b(p)=a$ . For $a(a+1) < p < (a+1)^2$ , then $b(p)=a+1$ . There are $a+1$ terms in the first set of $p$ , and $a$ terms in the second set. Thus, the sum of $b(p)$ from $a^2 \le p <(a+1)^2$ is $2a(a+1)$ or $4\cdot\binom{a+1}{2}$ . For the time being, consider that $S = \sum_{p=1}^{44^2-1} b(p)$ . Then, the sum of the values of $b(p)$ is $4\binom{2}{2}+4\binom{3}{2}+\cdots +4\binom{44}{2}=4\left(\binom{2}{2}+\binom{3}{2}+\cdots +\binom{44}{2}\right)$ . We can collapse this to $4\binom{45}{3}=56760$ . Now, we have to consider $p$ from $44^2 \le p < 2007$ . Considering $p$ from just $44^2 \le p \le 1980$ , we see that all of these values have $b(p)=44$ . Because there are $45$ values of $p$ in that range, the sum of $b(p)$ in that range is $45\cdot44=1980$ . Adding this to $56760$ we get $58740$ or $740$ mod $1000$ . Now, take the range $1980 < p \le 2007$ . There are $27$ values of $p$ in this range, and each has $b(p)=45$ . Thus, that contributes $27*45=1215$ or $215$ to the sum. Finally, adding $740$ and $215$ we get $740+215=\boxed{955}$

Answer:  955
Problem: In isosceles triangle $\triangle ABC$ $A$ is located at the origin and $B$ is located at $(20,0)$ .  Point $C$ is in the first quadrant with $AC = BC$ and angle $BAC = 75^{\circ}$ .  If triangle $ABC$ is rotated counterclockwise about point $A$ until the image of $C$ lies on the positive $y$ -axis, the area of the region common to the original and the rotated triangle is in the form $p\sqrt{2} + q\sqrt{3} + r\sqrt{6} + s$ , where $p,q,r,s$ are integers.  Find $\frac{p-q+r-s}2$

Solution: Redefine the points in the same manner as the last time ( $\triangle AB'C'$ , intersect at $D$ $E$ , and $F$ ). This time, notice that $[ADEF] = [\triangle AB'C'] - ([\triangle ADC'] + [\triangle EFB'])$
The area of $[\triangle AB'C'] = [\triangle ABC]$ . The altitude of $\triangle ABC$ is clearly $10 \tan 75 = 10 \tan (30 + 45)$ . The tangent addition rule yields $10(2 + \sqrt{3})$ (see above). Thus, $[\triangle ABC] = \frac{1}{2} 20 \cdot (20 + 10\sqrt{3}) = 200 + 100\sqrt{3}$
The area of $[\triangle ADC']$ (with a side on the y-axis) can be found by splitting it into two triangles, $30-60-90$ and $15-75-90$ right triangles $AC' = AC = \frac{10}{\sin 15}$ . The sine subtraction rule shows that $\frac{10}{\sin 15} = \frac{10}{\frac{\sqrt{6} - \sqrt{2}}4} = \frac{40}{\sqrt{6} - \sqrt{2}} = 10(\sqrt{6} + \sqrt{2})$ $AC'$ , in terms of the height of $\triangle ADC'$ , is equal to $h(\sqrt{3} + \tan 75) = h(\sqrt{3} + 2 + \sqrt{3})$ \begin{align*} [ADC'] &= \frac 12 AC' \cdot h \\ &= \frac 12 (10\sqrt{6} + 10\sqrt{2})\left(\frac{10\sqrt{6} + 10\sqrt{2}}{2\sqrt{3} + 2}\right) \\ &= \frac{(800 + 400\sqrt{3})}{(2 + \sqrt{3})}\cdot\frac{2 - \sqrt{3}}{2-\sqrt{3}} \\ &= \frac{400\sqrt{3} + 400}8 = 50\sqrt{3} + 50 \end{align*}
The area of $[\triangle EFB']$ was found in the previous solution to be $- 500\sqrt{2} + 400\sqrt{3} - 300\sqrt{6} +750$
Therefore, $[ADEF]$ $= (200 + 100\sqrt{3}) - \left((50 + 50\sqrt{3}) + (-500\sqrt{2} + 400\sqrt{3} - 300\sqrt{6} +750)\right)$ $= 500\sqrt{2} - 350\sqrt{3} + 300\sqrt{6} - 600$ , and our answer is $\boxed{875}$

Answer:  875
Problem: In isosceles triangle $\triangle ABC$ $A$ is located at the origin and $B$ is located at $(20,0)$ .  Point $C$ is in the first quadrant with $AC = BC$ and angle $BAC = 75^{\circ}$ .  If triangle $ABC$ is rotated counterclockwise about point $A$ until the image of $C$ lies on the positive $y$ -axis, the area of the region common to the original and the rotated triangle is in the form $p\sqrt{2} + q\sqrt{3} + r\sqrt{6} + s$ , where $p,q,r,s$ are integers.  Find $\frac{p-q+r-s}2$

Solution: Call the points of the intersections of the triangles $D$ $E$ , and $F$ as noted in the diagram (the points are different from those in the diagram for solution 1). $\overline{AD}$ bisects $\angle EDE'$
Through HL congruency, we can find that $\triangle AED$ is congruent to $\triangle AE'D$ . This divides the region $AEDF$ (which we are trying to solve for) into two congruent triangles and an isosceles right triangle
Since $FE' = AE' = AE$ , we find that $[AE'F] = \frac 12 (5\sqrt{6} + 5\sqrt{2})^2 = 100 + 50\sqrt{3}$
Now, we need to find $[AED] = [AE'D]$ . The acute angles of the triangles are $\frac{15}{2}$ and $90 - \frac{15}{2}$ . By repeated application of the half-angle formula , we can find that $\tan \frac{15}{2} = \sqrt{2} - \sqrt{3} + \sqrt{6} - 2$
The area of $[AED] = \frac 12 \left(20 \cos 15\right)^2 \left(\tan \frac{15}{2}\right)$ . Thus, $[AED] + [AE'D] = 2\left(\frac 12((5\sqrt{6} + 5\sqrt{2})^2 \cdot (\sqrt{2} - \sqrt{3} + \sqrt{6} - 2))\right)$ , which eventually simplifies to $500\sqrt{2} - 350\sqrt{3} + 300\sqrt{6} - 600$
Adding them together, we find that the solution is $[AEDF] = [AE'F] + [AED] + [AE'D]$ $= 100 + 50\sqrt{3} + 500\sqrt{2} - 350\sqrt{3} + 300\sqrt{6} - 600=$ $= 500\sqrt{2} - 350\sqrt{3} + 300\sqrt{6} - 600$ , and the answer is $\boxed{875}$

Answer:  875
Problem: In isosceles triangle $\triangle ABC$ $A$ is located at the origin and $B$ is located at $(20,0)$ .  Point $C$ is in the first quadrant with $AC = BC$ and angle $BAC = 75^{\circ}$ .  If triangle $ABC$ is rotated counterclockwise about point $A$ until the image of $C$ lies on the positive $y$ -axis, the area of the region common to the original and the rotated triangle is in the form $p\sqrt{2} + q\sqrt{3} + r\sqrt{6} + s$ , where $p,q,r,s$ are integers.  Find $\frac{p-q+r-s}2$

Solution: From the given information, calculate the coordinates of all the points (by finding the equations of the lines, equating). Then, use the shoelace method to calculate the area of the intersection.
Now, we can equate the equations to find the intersections of all the points.
We take these points and tie them together by shoelace, and the answer should come out to be $\boxed{875}$

Answer:  875
Problem: A square pyramid with base $ABCD$ and vertex $E$ has eight edges of length $4$ .  A plane passes through the midpoints of $AE$ $BC$ , and $CD$ .  The plane's intersection with the pyramid has an area that can be expressed as $\sqrt{p}$ .  Find $p$
AIME I 2007-13.png

Solution: Note first that the intersection is a pentagon
Use 3D analytical geometry, setting the origin as the center of the square base and the pyramid’s points oriented as shown above. $A(-2,2,0),\ B(2,2,0),\ C(2,-2,0),\ D(-2,-2,0),\ E(0,2\sqrt{2})$ . Using the coordinates of the three points of intersection $(-1,1,\sqrt{2}),\ (2,0,0),\ (0,-2,0)$ , it is possible to determine the equation of the plane. The equation of a plane resembles $ax + by + cz = d$ , and using the points we find that $2a = d \Longrightarrow d = \frac{a}{2}$ $-2b = d \Longrightarrow d = \frac{-b}{2}$ , and $-a + b + \sqrt{2}c = d \Longrightarrow -\frac{d}{2} - \frac{d}{2} + \sqrt{2}c = d \Longrightarrow c = d\sqrt{2}$ . It is then $x - y + 2\sqrt{2}z = 2$
Write the equation of the lines and substitute to find that the other two points of intersection on $\overline{BE}$ $\overline{DE}$ are $\left(\frac{\pm 3}{2},\frac{\pm 3}{2},\frac{\sqrt{2}}{2}\right)$ . To find the area of the pentagon, break it up into pieces (an isosceles triangle on the top, an isosceles trapezoid on the bottom). Using the distance formula $\sqrt{a^2 + b^2 + c^2}$ ), it is possible to find that the area of the triangle is $\frac{1}{2}bh \Longrightarrow \frac{1}{2} 3\sqrt{2} \cdot \sqrt{\frac 52} = \frac{3\sqrt{5}}{2}$ . The trapezoid has area $\frac{1}{2}h(b_1 + b_2) \Longrightarrow \frac 12\sqrt{\frac 52}\left(2\sqrt{2} + 3\sqrt{2}\right) = \frac{5\sqrt{5}}{2}$ . In total, the area is $4\sqrt{5} = \sqrt{80}$ , and the solution is $\boxed{080}$

Answer:  080