Navvye/Olympiad-Problems-CSV huggingface dataset:
Problem: A bored student walks down a hall that contains a row of closed lockers, numbered $1$ to $1024$ . He opens the locker numbered 1, and then alternates between skipping and opening each locker thereafter. When he reaches the end of the hall, the student turns around and starts back. He opens the first closed locker he encounters, and then alternates between skipping and opening each closed locker thereafter. The student continues wandering back and forth in this manner until every locker is open. What is the number of the last locker he opens?

Solution: On his first pass, he opens all of the odd lockers. So there are only even lockers closed. Then he opens the lockers that are multiples of $4$ , leaving only lockers $2 \pmod{8}$ and $6 \pmod{8}$ . Then he goes ahead and opens all lockers $2 \pmod {8}$ , leaving lockers either $6 \pmod {16}$ or $14 \pmod {16}$ . He then goes ahead and opens all lockers $14 \pmod {16}$ , leaving the lockers either $6 \pmod {32}$ or $22 \pmod {32}$ . He then goes ahead and opens all lockers $6 \pmod {32}$ , leaving $22 \pmod {64}$ or $54 \pmod {64}$ . He then opens $54 \pmod {64}$ , leaving $22 \pmod {128}$ or $86 \pmod {128}$ . He then opens $22 \pmod {128}$ and leaves $86 \pmod {256}$ and $214 \pmod {256}$ . He then opens all $214 \pmod {256}$ , so we have $86 \pmod {512}$ and $342 \pmod {512}$ , leaving lockers $86, 342, 598$ , and $854$ , and he is at where he started again. He then opens $86$ and $598$ , and then goes back and opens locker number $854$ , leaving locker number $\boxed{342}$ untouched. He opens that locker.

Answer:  342
Problem: A bored student walks down a hall that contains a row of closed lockers, numbered $1$ to $1024$ . He opens the locker numbered 1, and then alternates between skipping and opening each locker thereafter. When he reaches the end of the hall, the student turns around and starts back. He opens the first closed locker he encounters, and then alternates between skipping and opening each closed locker thereafter. The student continues wandering back and forth in this manner until every locker is open. What is the number of the last locker he opens?

Solution: We can also solve this with recursion. Let $L_n$ be the last locker he opens given that he started with $2^n$ lockers. Let there be $2^n$ lockers. After he first reaches the end of the hallway, there are $2^{n-1}$ lockers remaining. There is a correspondence between these unopened lockers and if he began with $2^{n-1}$ lockers. The locker $y$ (if he started with $2^{n-1}$ lockers) corresponds to the locker $2^n+2-2y$ (if he started with $2^n$ lockers). It follows that $L_{n} = 2^{n} +2 -2L_{n-1}$ as they are corresponding lockers. We can compute $L_1=2$ and use the recursion to find $L_{10}=\boxed{342}$

Answer:  342
Problem: A bored student walks down a hall that contains a row of closed lockers, numbered $1$ to $1024$ . He opens the locker numbered 1, and then alternates between skipping and opening each locker thereafter. When he reaches the end of the hall, the student turns around and starts back. He opens the first closed locker he encounters, and then alternates between skipping and opening each closed locker thereafter. The student continues wandering back and forth in this manner until every locker is open. What is the number of the last locker he opens?

Solution: List all the numbers from $1$ through $1024$ , then do the process yourself!!! It will take about 25 minutes (if you don't start to see the pattern), but that's okay, eventually, you will get $\boxed{342}$

Answer:  342
Problem: Find the smallest positive integer solution to $\tan{19x^{\circ}}=\dfrac{\cos{96^{\circ}}+\sin{96^{\circ}}}{\cos{96^{\circ}}-\sin{96^{\circ}}}$

Solution: $\dfrac{\cos{96^{\circ}}+\sin{96^{\circ}}}{\cos{96^{\circ}}-\sin{96^{\circ}}} =$ $\dfrac{\sin{186^{\circ}}+\sin{96^{\circ}}}{\sin{186^{\circ}}-\sin{96^{\circ}}} =$ $\dfrac{\sin{(141^{\circ}+45^{\circ})}+\sin{(141^{\circ}-45^{\circ})}}{\sin{(141^{\circ}+45^{\circ})}-\sin{(141^{\circ}-45^{\circ})}} =$ $\dfrac{2\sin{141^{\circ}}\cos{45^{\circ}}}{2\cos{141^{\circ}}\sin{45^{\circ}}} = \tan{141^{\circ}}$
The period of the tangent function is $180^\circ$ , and the tangent function is one-to-one over each period of its domain.
Thus, $19x \equiv 141 \pmod{180}$
Since $19^2 \equiv 361 \equiv 1 \pmod{180}$ , multiplying both sides by $19$ yields $x \equiv 141 \cdot 19 \equiv (140+1)(18+1) \equiv 0+140+18+1 \equiv 159 \pmod{180}$
Therefore, the smallest positive solution is $x = \boxed{159}$

Answer:  159
Problem: Find the smallest positive integer solution to $\tan{19x^{\circ}}=\dfrac{\cos{96^{\circ}}+\sin{96^{\circ}}}{\cos{96^{\circ}}-\sin{96^{\circ}}}$

Solution: $\dfrac{\cos{96^{\circ}}+\sin{96^{\circ}}}{\cos{96^{\circ}}-\sin{96^{\circ}}} = \dfrac{1 + \tan{96^{\circ}}}{1-\tan{96^{\circ}}}$ which is the same as $\dfrac{\tan{45^{\circ}} + \tan{96^{\circ}}}{1-\tan{45^{\circ}}\tan{96^{\circ}}} = \tan{141{^\circ}}$
So $19x = 141 +180n$ , for some integer $n$ .
Multiplying by $19$ gives $x \equiv 141 \cdot 19 \equiv 2679 \equiv 159 \pmod{180}$ .
The smallest positive solution of this is $x = \boxed{159}$

Answer:  159
Problem: Find the smallest positive integer solution to $\tan{19x^{\circ}}=\dfrac{\cos{96^{\circ}}+\sin{96^{\circ}}}{\cos{96^{\circ}}-\sin{96^{\circ}}}$

Solution: It seems reasonable to assume that $\dfrac{\cos{96^{\circ}}+\sin{96^{\circ}}}{\cos{96^{\circ}}-\sin{96^{\circ}}} = \tan{\theta}$ for some angle $\theta$ . This means \[\dfrac{\alpha (\cos{96^{\circ}}+\sin{96^{\circ}})}{\alpha (\cos{96^{\circ}}-\sin{96^{\circ}})} = \frac{\sin{\theta}}{\cos{\theta}}\] for some constant $\alpha$ . We can set $\alpha (\cos{96^{\circ}}+\sin{96^{\circ}}) = \sin{\theta}$ .Note that if we have $\alpha$ equal to both the sine and cosine of an angle, we can use the sine sum formula (and the cosine sum formula on the denominator). So, since $\sin{45^{\circ}} = \cos{45^{\circ}} = \tfrac{\sqrt{2}}{2}$ , if $\alpha = \tfrac{\sqrt{2}}{2}$ we have \[\alpha (\cos{96^{\circ}} + \sin{96^{\circ}}) = \cos{96^{\circ}} \frac{\sqrt{2}}{2} + \sin{96^{\circ}} \frac{\sqrt{2}}{2} = \cos{96^{\circ}} \sin{45^{\circ}} + \sin{96^{\circ}} \cos{45^{\circ}} = \sin({45^{\circ} + 96^{\circ}}) = \sin{141^{\circ}}\] from the sine sum formula. For the denominator, from the cosine sum formula, we have \[\alpha (\cos{96^{\circ}} - \sin{96^{\circ}}) = \cos{96^{\circ}} \frac{\sqrt{2}}{2} + \sin{96^{\circ}} \frac{\sqrt{2}}{2} = \cos{96^{\circ}} \cos{45^{\circ}} + \sin{96^{\circ}} \sin{45^{\circ}} = \cos({96^{\circ}  + 45^{\circ}}) = \cos{141^{\circ}}.\] This means $\theta = 141^{\circ},$ so $19x = 141 + 180k$ for some positive integer $k$ (since the period of tangent is $180^{\circ}$ ), or $19 x \equiv 141 \pmod{180}$ . Note that the inverse of $19$ modulo $180$ is itself as $19^2 \equiv 361 \equiv 1 \pmod {180}$ , so multiplying this congruence by $19$ on both sides gives $x \equiv 2679 \equiv 159 \pmod{180}.$ For the smallest possible $x$ , we take $x = \boxed{159}.$

Answer:  159
Problem: Let $\mathrm {P}$ be the product of the roots of $z^6+z^4+z^3+z^2+1=0$ that have a positive imaginary part, and suppose that $\mathrm {P}=r(\cos{\theta^{\circ}}+i\sin{\theta^{\circ}})$ , where $0<r$ and $0\leq \theta <360$ . Find $\theta$

Solution: \begin{eqnarray*} 0 &=& z^6 - z + z^4 + z^3 + z^2 + z + 1 = z(z^5 - 1) + \frac{z^5-1}{z-1}\\ 0 &=& \frac{(z^5 - 1)(z(z-1)+1)}{z-1} = \frac{(z^2-z+1)(z^5-1)}{z-1} \end{eqnarray*}
Thus $z^5 = 1, z \neq 1 \Longrightarrow z = \mathrm{cis}\ 72, 144, 216, 288$
or $z^2 - z + 1 = 0 \Longrightarrow z = \frac{1 \pm \sqrt{-3}}{2} = \mathrm{cis}\ 60, 300$
(see cis ).
Discarding the roots with negative imaginary parts (leaving us with $\mathrm{cis} \theta,\ 0 < \theta < 180$ ), we are left with $\mathrm{cis}\ 60, 72, 144$ ; their product is $P = \mathrm{cis} (60 + 72 + 144) = \mathrm{cis} \boxed{276}$

Answer:  276
Problem: Let $\mathrm {P}$ be the product of the roots of $z^6+z^4+z^3+z^2+1=0$ that have a positive imaginary part, and suppose that $\mathrm {P}=r(\cos{\theta^{\circ}}+i\sin{\theta^{\circ}})$ , where $0<r$ and $0\leq \theta <360$ . Find $\theta$

Solution: Divide through by $z^3$ . We get the equation $z^3 + \frac {1}{z^3} + z + \frac {1}{z} + 1 = 0$ . Let $x = z + \frac {1}{z}$ . Then $z^3 + \frac {1}{z^3} = x^3 - 3x$ . Our equation is then $x^3 - 3x + x + 1 = x^3 - 2x + 1 = (x - 1)(x^2 + x - 1) = 0$ , with solutions $x = 1, \frac { - 1\pm\sqrt {5}}{2}$ . For $x = 1$ , we get $z = \text{cis}60,\text{cis}300$ . For $x = \frac { - 1 + \sqrt {5}}{2}$ , we get $z = \text{cis}{72},\text{cis}{292}$ (using exponential form of $\cos$ ). For $x = \frac { - 1 - \sqrt {5}}{2}$ , we get $z = \text{cis}144,\text{cis}216$ . The ones with positive imaginary parts are ones where $0\le\theta\le180$ , so we have $60 + 72 + 144 = \boxed{276}$

Answer:  276
Problem: Let $\mathrm {P}$ be the product of the roots of $z^6+z^4+z^3+z^2+1=0$ that have a positive imaginary part, and suppose that $\mathrm {P}=r(\cos{\theta^{\circ}}+i\sin{\theta^{\circ}})$ , where $0<r$ and $0\leq \theta <360$ . Find $\theta$

Solution: We recognize that $z^6+z^5+z^4+z^3+z^2+z+1=\frac{z^7-1}{z-1}$ and strongly wish for the equation to turn into so. Thankfully, we can do this by simultaneously adding and subtracting $z^5$ and $z$ as shown below. $z^6+z^5+z^4+z^3+z^2+z+1-(z^5+z)=0\implies \frac{z^7-1}{z-1}-(z^5+z)=0$
Now, knowing that $z=1$ is not a root, we multiply by $z-1$ to obtain $z^7-1-(z-1)(z^5+z)=0\implies z^7-1-(z^6+z^2-z^5-z)=0\implies z^7-z^6+z^5-z^2+z-1=0$ Now, we see the $z^2+z-1$ and it reminds us of the sum of two cubes. Cleverly factoring, we obtain that.. $z^5(z^2-z)+z^5-(z^2-z+1)=0\implies z^5(z^2-z+1)-(z^2-z+1)=0\implies (z^5-1)(z^2-z+1)=0$
Now, it is clear that we have two cases to consider.
Case $1$ $z^5-1=0$ We obtain that $z^5=1$ or $z^5=e^{2\pi{n}{i}}$ Obviously, the answers to this case are $e^{ia}, a\in{\frac{2\pi}{5}, \frac{4\pi}{5}}$
Case $2$ $z^2-z+1=0$ Completing the square and then algebra allows us to find that $z=\frac{1}{2}\pm\frac{i\sqrt{3}}{2}$ which has $\arg$ $\frac{\pi}{3}$
Hence, the answer is $\frac{18\pi}{15}+\frac{5\pi}{15}=\frac{23\pi}{15}\cdot\frac{180}{\pi}=\boxed{276}$

Answer:  276
Problem: Let $\mathrm {P}$ be the product of the roots of $z^6+z^4+z^3+z^2+1=0$ that have a positive imaginary part, and suppose that $\mathrm {P}=r(\cos{\theta^{\circ}}+i\sin{\theta^{\circ}})$ , where $0<r$ and $0\leq \theta <360$ . Find $\theta$

Solution: Add 1 to both sides of the equation to get $x^6+x^4+x^3+x^2+1+1=1$ . We can rearrange to find that $(x^6+x^3+1)+(x^4+x^2+1)=1$ . Then, using sum of a geometric series, $\frac{x^9-1}{x^3-1}+\frac{x^6-1}{x^2-1}=1$
Combining the two terms of the LHS, we get that $\frac{x^{11}-x^9-x^2+1+x^9-x^6-x^3+1}{x^5-x^3-x^2+1}=1$ , so $x^{11}-x^6-x^3-x^2+2=x^5-x^3-x^2+1$ , and simplifying, we see that $x^{11}-x^6-x^5+1=0$ , so by SFFT, $(x^6-1)(x^5-1)=0$ . Then, the roots of our polynomial are the fifth and sixth roots of unity. However, looking back at our expression when it had fractions, we realize that if $x$ is a second or third root of unity, it would cause a denominator to be zero, so the roots of our polynomial are the fifth and sixth roots of unity that are not the second or third roots of unity. The only roots in this category are $\mathrm{cis} (60, 72, 144)$ , so our desired sum is $\boxed{276}$ , and we are done.

Answer:  276
Problem: For each permutation $a_1,a_2,a_3,\cdots,a_{10}$ of the integers $1,2,3,\cdots,10$ , form the sum
\[|a_1-a_2|+|a_3-a_4|+|a_5-a_6|+|a_7-a_8|+|a_9-a_{10}|.\]
The average value of all such sums can be written in the form $\dfrac{p}{q}$ , where $p$ and $q$ are relatively prime positive integers. Find $p+q$

Solution: Because of symmetry, we may find all the possible values for $|a_n - a_{n - 1}|$ and multiply by the number of times this value appears. Each occurs $5 \cdot 8!$ , because if you fix $a_n$ and $a_{n + 1}$ there are still $8!$ spots for the others and you can do this $5$ times because there are $5$ places $a_n$ and $a_{n + 1}$ can be.
To find all possible values for $|a_n - a_{n - 1}|$ we have to compute \begin{eqnarray*} |1 - 10| + |1 - 9| + \ldots + |1 - 2|\\ + |2 - 10| + \ldots + |2 - 3| + |2 - 1|\\ + \ldots\\ + |10 - 9| \end{eqnarray*}
This is equivalent to
\[2\sum\limits_{k = 1}^{9}\sum\limits_{j = 1}^{k}j = 330\]
The total number of permutations is $10!$ , so the average value is $\frac {330 \cdot  8!  \cdot  5}{10!} = \frac {55}{3}$ , and $m+n = \boxed{058}$

Answer:  058
Problem: For each permutation $a_1,a_2,a_3,\cdots,a_{10}$ of the integers $1,2,3,\cdots,10$ , form the sum
\[|a_1-a_2|+|a_3-a_4|+|a_5-a_6|+|a_7-a_8|+|a_9-a_{10}|.\]
The average value of all such sums can be written in the form $\dfrac{p}{q}$ , where $p$ and $q$ are relatively prime positive integers. Find $p+q$

Solution: Without loss of generality , let $a_1 > a_2;\, a_3 > a_4;\, \ldots ;\, a_9 > a_{10}$ . We may do this because all sums obtained from these paired sequences are also obtained in another $2^5-1$ ways by permuting the adjacent terms $\{a_1,a_2\},\{a_3,a_4\}, \cdots , \{a_9, a_{10}\}$ , and thus are canceled when the average is taken.
So now we only have to form the sum $S= (a_1 + a_3 + a_5 + a_7 + a_9) - (a_2 + a_4 + a_6 + a_8 + a_{10})$ . Due to the symmetry of this situation, we only need to compute the expected value of the result. $10$ must always be the greatest number in its pair; $9$ will be the greater number in its pair $\frac{8}{9}$ of the time and the lesser number $\frac 19$ of the time; $8$ will be the greater number in its pair $\frac 79$ of the time and the lesser $\frac 29$ of the time; and so forth. Each number either adds or subtracts from the sum depending upon whether it is one of the five greater or five lesser numbers in the pairs, respectively. Thus
\begin{align*} \overline{S} &= 10 + \left(\frac{8}{9} \cdot 9\right) - \left(\frac{1}{9} \cdot 9\right) + \left(\frac{7}{9} \cdot 8\right) - \left(\frac 29 \cdot 8\right) + \cdots + \left(\frac{1}{9} \cdot 2\right) - \left(\frac{8}{9} \cdot 2\right) - 1 \\ &= \frac{9 \cdot 10 + 7 \cdot 9 + 5 \cdot 8 + 3 \cdot 7 + 1 \cdot 6 - 1 \cdot 5 - 3 \cdot 4 - 5 \cdot 3 - 7 \cdot 2 - 9 \cdot 1}{9} \\ &= \frac{55}{3} \end{align*}
And the answer is $m+n = \boxed{058}$

Answer:  058
Problem: For each permutation $a_1,a_2,a_3,\cdots,a_{10}$ of the integers $1,2,3,\cdots,10$ , form the sum
\[|a_1-a_2|+|a_3-a_4|+|a_5-a_6|+|a_7-a_8|+|a_9-a_{10}|.\]
The average value of all such sums can be written in the form $\dfrac{p}{q}$ , where $p$ and $q$ are relatively prime positive integers. Find $p+q$

Solution: Similar to Solution 1, we can find the average value of $|a_2 - a_1|$ , and multiply this by 5 due to symmetry.  And again due to symmetry, we can arbitrarily choose $a_2 > a_1$ .  Thus there are $\binom{10}{2} = 45$ ways to pick the two values of $a_2$ and $a_1$ from the set $\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}$ such that $a_2 > a_1$ .  First fix $a_2 = 10$ , and vary $a_1$ from $1$ to $9$ .  Then fix $a_2 = 9$ , and vary $a_1$ from $1$ to $8$ .  Continue, and you find that the sum of these $45$ ways to pick $|a_2 - a_1|$ is:
$\sum\limits_{k = 1}^{9}\sum\limits_{j = 1}^{k}j = 45+36+28+21+15+10+6+3+1 = 165$
Thus, each term contributes on average $\frac{165}{45}$ , and the sum will be five times this, or $\frac{165}{9} = \frac{55}{3}$
The final answer is $p+q = \boxed{058}$

Answer:  058
Problem: For each permutation $a_1,a_2,a_3,\cdots,a_{10}$ of the integers $1,2,3,\cdots,10$ , form the sum
\[|a_1-a_2|+|a_3-a_4|+|a_5-a_6|+|a_7-a_8|+|a_9-a_{10}|.\]
The average value of all such sums can be written in the form $\dfrac{p}{q}$ , where $p$ and $q$ are relatively prime positive integers. Find $p+q$

Solution: We use expected value of one of the sums, say $|a_2 - a_1|$ , since all five are similar, so the average or expected value of the sum is just 5 times the expected value of one of them.
To pick two random expected numbers from 1 to 10, we use a well known expected value trick by tying the two ends 1 and 10 with an extra number 0.* This gives 11 spaces, and we distribute 3 gaps evenly to choose our two numbers. We get $\frac{11}{3}$ and $\frac{22}{3}$ giving an absolute difference of $\frac{11}{3}$ . Therefore, the average/expected value of the sum of the five would be $\frac{55}{3}$ . This gives $55+3=\boxed{058}$

Answer:  058
Problem: In triangle $ABC$ $AB=\sqrt{30}$ $AC=\sqrt{6}$ , and $BC=\sqrt{15}$ . There is a point $D$ for which $\overline{AD}$ bisects $\overline{BC}$ , and $\angle ADB$ is a right angle. The ratio $\frac{[ADB]}{[ABC]}$ can be written in the form $\dfrac{m}{n}$ , where $m$ and $n$ are relatively prime positive integers. Find $m+n$

Solution: Let $E$ be the midpoint of $\overline{BC}$ . Since $BE = EC$ , then $\triangle ABE$ and $\triangle AEC$ share the same height and have equal bases, and thus have the same area. Similarly, $\triangle BDE$ and $BAE$ share the same height, and have bases in the ratio $DE : AE$ , so $\frac{[BDE]}{[BAE]} = \frac{DE}{AE}$ (see area ratios ). Now,
By Stewart's Theorem $AE = \frac{\sqrt{2(AB^2 + AC^2) - BC^2}}2 = \frac{\sqrt {57}}{2}$ , and by the Pythagorean Theorem on $\triangle ABD, \triangle EBD$
\begin{align*} BD^2 + \left(DE + \frac {\sqrt{57}}2\right)^2 &= 30 \\ BD^2 + DE^2 &= \frac{15}{4} \\ \end{align*}
Subtracting the two equations yields $DE\sqrt{57} + \frac{57}{4} = \frac{105}{4} \Longrightarrow DE = \frac{12}{\sqrt{57}}$ . Then $\frac mn = \frac{1}{2} + \frac{DE}{2AE} = \frac{1}{2} + \frac{\frac{12}{\sqrt{57}}}{2 \cdot \frac{\sqrt{57}}{2}} = \frac{27}{38}$ , and $m+n = \boxed{065}$

Answer:  065
Problem: In triangle $ABC$ $AB=\sqrt{30}$ $AC=\sqrt{6}$ , and $BC=\sqrt{15}$ . There is a point $D$ for which $\overline{AD}$ bisects $\overline{BC}$ , and $\angle ADB$ is a right angle. The ratio $\frac{[ADB]}{[ABC]}$ can be written in the form $\dfrac{m}{n}$ , where $m$ and $n$ are relatively prime positive integers. Find $m+n$

Solution: Because the problem asks for a ratio, we can divide each side length by $\sqrt{3}$ to make things simpler. We now have a triangle with sides $\sqrt{10}$ $\sqrt{5}$ , and $\sqrt{2}$
We use the same graph as above.
Draw perpendicular from $C$ to $AE$ . Denote this point as $F$ . We know that $DE = EF = x$ and $BD = CF = z$ and also let $AE = y$
Using Pythagorean theorem, we get three equations,
Adding the first and second, we obtain $x^2 + y^2 + z^2 = 6$ , and then subtracting the third from this we find that $y = \frac{\sqrt{19}}{2}$ . (Note, we could have used Stewart's Theorem to achieve this result).
Subtracting the first and second, we see that $xy = 2$ , and then we find that $x = \frac{4}{\sqrt{19}}$
Using base ratios, we then quickly find that the desired ratio is $\frac{27}{38}$ so our answer is $\boxed{065}$

Answer:  065
Problem: $150\times 324\times 375$ rectangular solid is made by gluing together $1\times 1\times 1$ cubes. An internal diagonal of this solid passes through the interiors of how many of the $1\times 1\times 1$ cubes

Solution: Place one corner of the solid at $(0,0,0)$ and let $(a,b,c)$ be the general coordinates of the diagonally opposite corner of the rectangle, where $a, b, c \in \mathbb{Z_{+}}$
We consider the vector equation of the diagonal segment represented by: $(x, y, z) =m (a, b, c)$ , where $m \in \mathbb{R}, 0 < m \le 1$
Consider a point on the diagonal with coordinates $(ma, mb, mc)$ . We have 3 key observations as this point moves from $(0,0,0)$ towards $(a,b,c)$
The number of cubes the diagonal passes is equal to the number of points on the diagonal that has one or more positive integers as coordinates.
If we slice the solid up by the $x$ -planes defined by $x=1,2,3,4, \ldots, a$ , the diagonal will cut these $x$ -planes exactly $a$ times (plane of $x=0$ is not considered since $m \ne 0$ ). Similar arguments for slices along $y$ -planes and $z$ -planes give diagonal cuts of $b$ , and $c$ times respectively. The total cuts by the diagonal is therefore $a+b+c$ , if we can ensure that no more than $1$ positive integer is present in the x, y, or z coordinate in all points $(ma,mb,mc)$ on the diagonal. Note that point $(a,b,c)$ is already one such exception.
But for each diagonal point $(ma,mb,mc)$ with 2 (or more) positive integers occurring at the same time, $a+b+c$ counts the number of cube passes as $2$ instead of $1$ for each such point.  There are $\gcd(a,b)+\gcd(b,c)+\gcd(c,a)$ points in such over-counting. We therefore subtract one time such over-counting from $a+b+c$
And for each diagonal point $(ma,mb,mc)$ with exactly $3$ integers occurring at the same time, $a+b+c$ counts the number of cube passes as $3$ instead of $1$ ; ie $a+b+c$ over-counts each of such points by $2$ . But since $\gcd(a,b)+\gcd(b,c)+\gcd(c,a)$ already subtracted three times for the case of $3$ integers occurring at the same time (since there are $3$ of these gcd terms that represent all combinations of 3 edges of a cube meeting at a vertex), we  have the final count for each such point as $1 = 3-3+k \Rightarrow k=1$ , where $k$ is our correction term. That is, we need to add $k=1$ time $\gcd(a,b,c)$ back to account for the case of 3 simultaneous integers.
Therefore, the total diagonal cube passes is: $D = a+b+c-\left[ \gcd(a,b)+\gcd(b,c)+\gcd(c,a) \right]+\gcd(a,b,c)$
For $(a,b,c) = (150, 324, 375)$ , we have: $\gcd(150,324)=6$ $\gcd(324,375)=3$ $\gcd(150,375)=75$ $\gcd(150,324,375)=3$
Therefore $D = 150+324+375-(6+3+75)+3 = \boxed{768}$

Answer:  768
Problem: $150\times 324\times 375$ rectangular solid is made by gluing together $1\times 1\times 1$ cubes. An internal diagonal of this solid passes through the interiors of how many of the $1\times 1\times 1$ cubes

Solution: Consider a point travelling across the internal diagonal, and let the internal diagonal have a length of $d$ . The point enters a new unit cube in the $x,y,z$ dimensions at multiples of $\frac{d}{150}, \frac{d}{324}, \frac{d}{375}$ respectively. We proceed by using PIE.
The point enters a new cube in the $x$ dimension $150$ times, in the $y$ dimension $324$ times and in the $z$ dimension, $375$ times.
The point enters a new cube in the $x$ and $y$ dimensions whenever a multiple of $\frac{d}{150}$ equals a multiple of $\frac{d}{324}$ . This occurs $\gcd(150, 324)$ times. Similarly, a point enters a new cube in the $y,z$ dimensions $\gcd(324, 375)$ times and a point enters a new cube in the $z,x$ dimensions $\gcd(375, 150)$ times.
The point enters a new cube in the $x,y$ and $z$ dimensions whenever some multiples of $\frac{d}{150}, \frac{d}{324}, \frac{d}{375}$ are equal. This occurs $\gcd(150, 324, 375)$ times.
The total number of unit cubes entered is then $150+324+375-[\gcd(150, 324)+\gcd(324, 375)+\gcd(375, 150)] + \gcd(150, 324, 375) = \boxed{768}$

Answer:  768
Problem: In parallelogram $ABCD$ , let $O$ be the intersection of diagonals $\overline{AC}$ and $\overline{BD}$ . Angles $CAB$ and $DBC$ are each twice as large as angle $DBA$ , and angle $ACB$ is $r$ times as large as angle $AOB$ . Find $\lfloor 1000r \rfloor$

Solution: Let $\theta = \angle DBA$ . Then $\angle CAB = \angle DBC = 2\theta$ $\angle AOB = 180 - 3\theta$ , and $\angle ACB = 180 - 5\theta$ . Since $ABCD$ is a parallelogram, it follows that $OA = OC$ . By the Law of Sines on $\triangle ABO,\, \triangle BCO$
Dividing the two equalities yields
\[\frac{\sin 2\theta}{\sin \theta} = \frac{\sin (180 - 5\theta)}{\sin 2\theta} \Longrightarrow \sin^2 2\theta = \sin 5\theta \sin \theta.\]
Pythagorean and product-to-sum identities yield
\[1 - \cos^2 2 \theta = \frac{\cos 4\theta - \cos 6 \theta}{2},\]
and the double and triple angle ( $\cos 3x = 4\cos^3 x - 3\cos x$ ) formulas further simplify this to
\[4\cos^3 2\theta - 4\cos^2 2\theta - 3\cos 2\theta + 3 = (4\cos^2 2\theta - 3)(\cos 2\theta - 1) = 0\]
The only value of $\theta$ that fits in this context comes from $4 \cos^2 2\theta - 3 = 0 \Longrightarrow \cos 2\theta = \frac{\sqrt{3}}{2} \Longrightarrow \theta = 15^{\circ}$ . The answer is $\lfloor 1000r \rfloor = \left\lfloor 1000 \cdot \frac{180 - 5\theta}{180 - 3\theta} \right\rfloor = \left \lfloor \frac{7000}{9} \right \rfloor = \boxed{777}$

Answer:  777