Navvye/Olympiad-Problems-CSV huggingface dataset:
Problem: With all angles measured in degrees, the product $\prod_{k=1}^{45} \csc^2(2k-1)^\circ=m^n$ , where $m$ and $n$ are integers greater than 1. Find $m+n$

Solution: Let $p=\prod_{k=1}^{45} \csc^2(2k-1)^\circ$
Then, $\sqrt{\frac{1}{p}}=\prod_{k=1}^{45} \sin(2k-1)^\circ$
Since $\sin\theta=\cos(90^{\circ}-\theta)$ , we can multiply both sides by $\frac{\sqrt{2}}{2}$ to get $\sqrt{\frac{1}{2p}}=\prod_{k=1}^{23} \sin(2k-1)^\circ\cos(2k-1)^\circ$
Using the double-angle identity $\sin2\theta=2\sin\theta\cos\theta$ , we get $\sqrt{\frac{1}{2p}}=\frac{1}{2^{23}}\prod_{k=1}^{23} \sin(4k-2)^\circ$
Note that the right-hand side is equal to $\frac{1}{2^{23}}\prod_{k=1}^{45} \sin(2k)^\circ\div \prod_{k=1}^{22} \sin(4k)^\circ$ , which is equal to $\frac{1}{2^{23}}\prod_{k=1}^{45} \sin(2k)^\circ\div \prod_{k=1}^{22} 2\sin(2k)^\circ\cos(2k)^\circ$ , again, from using our double-angle identity.
Putting this back into our equation and simplifying gives us $\sqrt{\frac{1}{2p}}=\frac{1}{2^{45}}\prod_{k=23}^{45} \sin(2k)^\circ\div \prod_{k=1}^{22} \cos(2k)^\circ$
Using the fact that $\sin\theta=\cos(90^{\circ}-\theta)$ again, our equation simplifies to $\sqrt{\frac{1}{2p}}=\frac{\sin90^\circ}{2^{45}}$ , and since $\sin90^\circ=1$ , it follows that $2p = 2^{90}$ , which implies $p=2^{89}$ . Thus, $m+n=2+89=\boxed{091}$

Answer:  091
Problem: With all angles measured in degrees, the product $\prod_{k=1}^{45} \csc^2(2k-1)^\circ=m^n$ , where $m$ and $n$ are integers greater than 1. Find $m+n$

Solution: Recall that $\sin\alpha\cdot \sin(60^{\circ}-\alpha)\cdot \sin(60^{\circ}+\alpha)=\frac{1}{4}\cdot \sin3\alpha$ Since it is in csc, we can write in sin and then take reciprocal.
We can group them by threes, $P=(\sin1^{\circ}\cdot \sin59^{\circ}\cdot \sin61^{\circ})\cdots(\sin29^{\circ}\cdot \sin31^{\circ}\cdot \sin89^{\circ})$ . Thus \begin{align*} P &=\frac{1}{4^{15}}\cdot \sin3^{\circ}\cdot \sin9^{\circ}\cdots\sin87^{\circ}\\ &=\frac{1}{4^{20}}\cdot \sin9^{\circ}\cdot \sin27^{\circ}\cdot \sin45^{\circ}\cdot \sin63^{\circ}\cdot \sin81^{\circ}\\ &=\frac{1}{4^{20}}\cdot \frac{\sqrt{2}}{2}\cdot \sin9^{\circ}\cdot \cos9^{\circ}\cdot \sin27^{\circ}\cdot \cos27^{\circ}\\ &=\frac{1}{4^{21}}\cdot \frac{\sqrt{2}}{2}\cdot \sin18^{\circ}\cdot \cos36^{\circ}=\frac{\sqrt{2}}{2^{45}} \end{align*} So we take reciprocal, $\frac 1P=2^{\frac{89}{2}}$ , the desired answer is $\frac{1}{P^2}=2^{89}$ leads to answer $\boxed{091}$

Answer:  091
Problem: With all angles measured in degrees, the product $\prod_{k=1}^{45} \csc^2(2k-1)^\circ=m^n$ , where $m$ and $n$ are integers greater than 1. Find $m+n$

Solution: We have
\[\prod_{k=1}^{45} \csc^2(2k-1)^\circ = \left(\frac{1}{\sin1^\circ \cdot \sin3^\circ \cdots \sin89^\circ}\right)^2.\]
Multiplying by $\frac{\sin2^\circ \cdot \sin4^\circ \cdots \sin88^\circ}{\sin2^\circ \cdot \sin4^\circ \cdots \sin88^\circ}$ gives
\[\left(\frac{\sin2^\circ \cdot \sin4^\circ \cdots \sin88^\circ}{\sin1^\circ \sin2^\circ \cdot \sin3^\circ \cdots \sin88^\circ \cdot \sin89^\circ}\right)^2\]
\[= \left(\frac{\sin2^\circ \cdot \sin4^\circ \cdots \sin88^\circ}{\sin1^\circ \sin2^\circ \cdot \sin3^\circ \cdots \sin 45^\circ \cdot \cos 44^\circ \cdot \cos 43^\circ \cdots \cos1^\circ}\right)^2.\]
Using $\sin\alpha \cos\alpha = \frac{1}{2}\sin{2\alpha}$ gives
\[\left(\frac{\sin2^\circ \cdot \sin4^\circ \cdots \sin88^\circ}{\frac{1}{2} \sin2^\circ \cdot \frac{1}{2} \sin4^\circ \cdots \frac{1}{2} \sin88^\circ \cdot \sin45^\circ}\right) ^2\]
\[= \left(\frac{1}{(\frac{1}{2})^{44} \cdot \frac{\sqrt{2}}{2}}\right)^2\]
\[= 2^{89}.\]
Thus, the answer is $2+89 = \boxed{091}.$

Answer:  091
Problem: For each integer $n \ge 2$ , let $A(n)$ be the area of the region in the coordinate plane defined by the inequalities $1\le x \le n$ and $0\le y \le x \left\lfloor \sqrt x \right\rfloor$ , where $\left\lfloor \sqrt x \right\rfloor$ is the greatest integer not exceeding $\sqrt x$ . Find the number of values of $n$ with $2\le n \le 1000$ for which $A(n)$ is an integer.

Solution: Let $n\ge 2$ and define $a(n) = \left\lfloor \sqrt n \right\rfloor$ . For $2\le n \le 1000$ , we have $1\le a(n)\le 31$
For $a^2 \le x < (a+1)^2$ we have $y=ax$ . Thus $A(n+1)-A(n)=a(n+\tfrac 12) = \Delta_n$ (say), and $\Delta_n$ is an integer if $a$ is even; otherwise $\Delta_n$ is an integer plus $\tfrac 12$
If $a=1$ $n\in \{1,2,3\}$ and $\Delta_n$ is of the form $k(n)+\tfrac 12$ so $A(n)$ is an integer when $n$ is even.
If $a=2$ $n\in\{4,\ldots , 8\}$ and $\Delta_n$ is an integer for all $n$ . Since $A(3)$ is not an integer, so $A(n)$ is not an integer for any $n$
If $a=3$ $n\in\{9,\ldots , 15\}$ and $\Delta_n$ is of the form $k(n)+\tfrac 12$ . Since $A(8)$ is of the form $k+\tfrac 12$ so $A(n)$ is an integer only when $n$ is odd.
If $a=4$ $n\in\{16,\ldots , 24\}$ and $\Delta_n$ is an integer for all $n$ . Since $A(15)$ is an integer so $A(n)$ is an integer for all $n$
Now we are back to where we started; i.e., the case $a=5$ will be the same as $a=1$ and so on. Thus, \begin{align} a(n)\equiv 1\pmod 4 \qquad &\Longrightarrow \qquad A(n) \in \mathbb{Z} \textrm{ for even } n, \\ a(n)\equiv 2\pmod 4 \qquad &\Longrightarrow \qquad A(n) \not\in \mathbb{Z} \textrm{  for any } n, \\ a(n)\equiv 3\pmod 4 \qquad &\Longrightarrow \qquad A(n) \in \mathbb{Z} \textrm{ for odd  } n, \\ a(n)\equiv 0\pmod 4 \qquad &\Longrightarrow \qquad A(n) \in \mathbb{Z} \textrm{ for all } n. \end{align}
For each $a$ there are $2a+1$ corresponding values of $n$ : i.e., $n\in \{a^2, \ldots , (a+1)^2-1\}$
Thus, the number of values of $n$ corresponding to $(4)$ (i.e., $a(n)\equiv 0\pmod 4$ ) is given by \[\sum_{\substack{a=4k \\ a\le 31}}(2a+1) = \sum_{k=1}^7 (8k+1)=231.\]
The cases $(1)$ and $(3)$ combine to account for half the values of $n$ corresponding to odd values of $a(n)$ ; i.e., \[\frac 12 \cdot \sum_{\substack{a=2k+1 \\ a\le 31}} (2a+1) = \sum_{k=0}^{15} (2k+\tfrac 32) = 264\] However, this also includes the odd integers in $\{1001, \ldots , 1023\}$ . Subtracting $12$ to account for these, we get the  number of values of $n$ corresponding to cases $(1)$ and $(3)$ to be $264-12=252$
Adding the contributions from all cases we get our answer to be $231+252= \boxed{483}$

Answer:  483
Problem: For each integer $n \ge 2$ , let $A(n)$ be the area of the region in the coordinate plane defined by the inequalities $1\le x \le n$ and $0\le y \le x \left\lfloor \sqrt x \right\rfloor$ , where $\left\lfloor \sqrt x \right\rfloor$ is the greatest integer not exceeding $\sqrt x$ . Find the number of values of $n$ with $2\le n \le 1000$ for which $A(n)$ is an integer.

Solution: By considering the graph of this function, it is shown that the graph is composed of trapezoids ranging from $a^2$ to $(a+1)^2$ with the top made of diagonal line $y=ax$ . The width of each trapezoid is $3, 5, 7$ , etc. Whenever $a$ is odd, the value of $A(n)$ increases by an integer value, plus $\frac{1}{2}$ . Whenever $a$ is even, the value of $A(n)$ increases by an integer value. Since each trapezoid always has an odd width, every value of $n$ is not an integer when $a \pmod{4} \equiv 2$ , and is an integer when $a \pmod{4} \equiv 0$ . Every other value is an integer when $a$ is odd. Therefore, it is simply a matter of determining the number of values of $n$ where $a \pmod{4} \equiv 0$ $(5^2-4^2)+(9^2-8^2)+...+(29^2-28^2)$ ), and adding the number of values of $n$ where $a$ is odd ( $\frac{(2^2-1^2)+(4^2-3^2)+...+(30^2-29^2)+(1000-31^2)}{2}$ ). Adding the two values gives $231+252=\boxed{483}$

Answer:  483
Problem: For each integer $n \ge 2$ , let $A(n)$ be the area of the region in the coordinate plane defined by the inequalities $1\le x \le n$ and $0\le y \le x \left\lfloor \sqrt x \right\rfloor$ , where $\left\lfloor \sqrt x \right\rfloor$ is the greatest integer not exceeding $\sqrt x$ . Find the number of values of $n$ with $2\le n \le 1000$ for which $A(n)$ is an integer.

Solution: First, draw a graph of the function. Note that it is just a bunch of line segments. Since we only need to know whether or not $A(n)$ is an integer, we can take the area of each piece from some $x$ to $x+1$ (mod 1), aka the piece from $2$ to $3$ has area $\frac{1}{2} (\mod 1)$ . There are some patterns. Every time we increase $n$ starting with $2$ , we either add $0 (\mod 1)$ or $\frac{1}{2} (\mod 1)$ . We look at $\lfloor \sqrt{x} \rfloor$ for inspiration. Every time this floor (which is really the slope) is odd, there is always an addition of $\frac{1}{2} (\mod 1)$ , and whenever that slope is even, that addition is zero.
Take a few cases. For slope $=1$ , we see that only one value satisfies. Because the last value, $n=4$ , fails, and the numbers $n$ which have a slope of an even number don't change this modulus, all these do not satisfy the criterion. The pattern then comes back to the odds, and this time $\lfloor \frac{7}{2} \rfloor + 1 = 4$ values work. Since the work/fail pattern alternates, all the $n$ s with even slope, $[17, 25]$ , satisfy the criterion. This pattern is cyclic over period 4 of slopes.
Even summation of working cases: $9+17+25+...+57 = 231$ .
Odd summation: $1+4+5+8+9+12...+29$ and plus the $20$ cases from $n=[962, 1000]$ $252$ . Answer is $\boxed{483}$

Answer:  483
Problem: Let $N$ be the least positive integer that is both $22$ percent less than one integer and $16$ percent greater than another integer. Find the remainder when $N$ is divided by $1000$

Solution: If $N$ is $22$ percent less than one integer $k$ , then $N=\frac{78}{100}k=\frac{39}{50}k$ . In addition, $N$ is $16$ percent greater than another integer $m$ , so $N=\frac{116}{100}m=\frac{29}{25}m$ . Therefore, $k$ is divisible by $50$ and $m$ is divisible by $25$ . Setting these two equal, we have $\frac{39}{50}k=\frac{29}{25}m$ . Multiplying by $50$ on both sides, we get $39k=58m$
The smallest integers $k$ and $m$ that satisfy this are $k=1450$ and $m=975$ , so $N=1131$ . The answer is $\boxed{131}$

Answer:  131
Problem: Let $N$ be the least positive integer that is both $22$ percent less than one integer and $16$ percent greater than another integer. Find the remainder when $N$ is divided by $1000$

Solution: Continuing from Solution 1, we have $N=\frac{39}{50}k$ and $N=\frac{29}{25}m$ . It follows that $k=\frac{50}{39}N$ and $m=\frac{25}{29}N$ . Both $m$ and $k$ have to be integers, so, in order for that to be true, $N$ has to cancel the denominators of both $\frac{50}{39}$ and $\frac{25}{29}$ . In other words, $N$ is a multiple of both $29$ and $39$ . That makes $N=\operatorname{lcm}(29,39)=29\cdot39=1131$ . The answer is $\boxed{131}$

Answer:  131
Problem: Let $N$ be the least positive integer that is both $22$ percent less than one integer and $16$ percent greater than another integer. Find the remainder when $N$ is divided by $1000$

Solution: We can express $N$ as $0.78a$ and $1.22b$ , where $a$ and $b$ are some positive integers. $N=0.78a=1.22b\implies100N=78a=122b.$ Let us try to find the smallest possible value of $100N$ , first ignoring the integral constraint.
Obviously, we are just trying to find the LCM of $78$ and $116.$ They have no common factors but $2$ , so we multiply $78$ and $116$ and divide by $2$ to get $4524.$ This is obviously not divisible by $100$ , so this is not possible, as it would imply that $N=\dfrac{4524}{100},$ which is not an integer. This can be simplified to $\dfrac{1131}{25}$
We know that any possible value of $N$ will be an integral multiple of this value; the smallest such $N$ is achieved by multiplying this value by $25.$ We arrive at $1131$ , which is $\boxed{131}\mod1000.$

Answer:  131
Problem: In a new school $40$ percent of the students are freshmen, $30$ percent are sophomores, $20$ percent are juniors, and $10$ percent are seniors. All freshmen are required to take Latin, and $80$ percent of the sophomores, $50$ percent of the juniors, and $20$ percent of the seniors elect to take Latin. The probability that a randomly chosen Latin student is a sophomore is $\frac{m}{n}$ , where $m$ and $n$ are relatively prime positive integers. Find $m+n$

Solution: We see that $40\% \cdot 100\% + 30\% \cdot 80\% + 20\% \cdot 50\% + 10\% \cdot 20\% = 76\%$ of students are learning Latin. In addition, $30\% \cdot 80\% = 24\%$ of students are sophomores learning Latin. Thus, our desired probability is $\dfrac{24}{76}=\dfrac{6}{19}$ and our answer is $6+19=\boxed{025}$

Answer:  025
Problem: In a new school $40$ percent of the students are freshmen, $30$ percent are sophomores, $20$ percent are juniors, and $10$ percent are seniors. All freshmen are required to take Latin, and $80$ percent of the sophomores, $50$ percent of the juniors, and $20$ percent of the seniors elect to take Latin. The probability that a randomly chosen Latin student is a sophomore is $\frac{m}{n}$ , where $m$ and $n$ are relatively prime positive integers. Find $m+n$

Solution: Assume that there are $100$ students in the school. There are $40$ freshmen taking Latin, $24$ sophomores taking Latin, $10$ juniors taking Latin, and $2$ seniors taking Latin. We get the probability to be the number of sophomores taking Latin over the total number of students taking Latin, or $\dfrac{24}{76}$ . Simplifying, we get $\dfrac{6}{19}$ . Adding, we get $\boxed{025}$

Answer:  025
Problem: Let $m$ be the least positive integer divisible by $17$ whose digits sum to $17$ . Find $m$

Solution: The three-digit integers divisible by $17$ , and their digit sum: \[\begin{array}{c|c} m & s(m)\\ \hline 102 & 3 \\ 119 & 11\\ 136 & 10\\ 153 & 9\\ 170 & 8\\ 187 & 16\\ 204 & 6\\ 221 & 5\\ 238 & 13\\ 255 & 12\\ 272 & 11\\ 289 & 19\\ 306 & 9\\ 323 & 8\\ 340 & 7\\ 357 & 15\\ 374 & 14\\ 391 & 13\\ 408 & 12\\ 425 & 11\\ 442 & 10\\ 459 & 18\\ 476 & 17 \end{array}\]
Thus the answer is $\boxed{476}$

Answer:  476
Problem: Let $m$ be the least positive integer divisible by $17$ whose digits sum to $17$ . Find $m$

Solution: We can do the same thing as solution 1, except note the following fact: $102$ is a multiple of $17$ and its digits sum to $3$
Therefore, we can add it onto an existing multiple of $17$ that we know of to have $s(m) = 14$ , shown in the right-hand column, provided that its units digit is less than $8$ and its hundreds digit is less than $9$ . Unfortunately, $68$ does not fit the criteria, but $374$ does, meaning that, instead of continually adding multiples of $17$ , we can stop here and simply add $102$ to reach our final answer of $\boxed{476}$

Answer:  476
Problem: Let $m$ be the least positive integer divisible by $17$ whose digits sum to $17$ . Find $m$

Solution: The digit sum of a base $10$ integer $m$ is just $m\pmod{9}$ . In this problem, we know $17\mid m$ , or $m=17k$ for a positive integer $k$
Also, we know that $m\equiv 17\equiv -1\pmod{9}$ , or $17k\equiv -k\equiv -1\pmod{9}$
Obviously $k=1$ is a solution. This means in general, $k=9x+1$ is a solution for non-negative integer $x$
Checking the first few possible solutions, we find that $m=\boxed{476}$ is the first solution that has $s(m)=17$ , and we're done.

Answer:  476
Problem: Let $m$ be the least positive integer divisible by $17$ whose digits sum to $17$ . Find $m$

Solution: Since the sum of the digits in the base-10 representation of $m$ is $17$ , we must have $m\equiv 17 \pmod{9}$ or $m\equiv -1\pmod{9}$ .
We also know that since $m$ is divisible by 17, $m\equiv 0 \pmod{17}$
To solve this system of linear congruences, we can use the Chinese Remainder Theorem. If we set $m\equiv (-1)(17)(8)\pmod {153}$ , we find that $m\equiv 0\pmod{17}$ and $m\equiv -1\pmod{9}$ , because $17\cdot 8\equiv 136 \equiv 1\pmod{9}$ . The trick to getting here was to find the number $x$ such that $17x\equiv 1\pmod{9}$ , so that when we take things $\pmod{9}$ , the $17$ goes away. We can do this using the Extended Euclidean Algorithm or by guess and check to find that $x\equiv 8\pmod{9}$
Finally, since $m\equiv 17\pmod{153}$ , we repeatedly add multiples of $153$ until we get a number in which its digits sum to 17, which first happens when $m=\boxed{476}$

Answer:  476
Problem: Let $m$ be the least positive integer divisible by $17$ whose digits sum to $17$ . Find $m$

Solution: We proceed by casework on the number of digits. Clearly the answer must have at least two digits, seeing as the maximum digit sum for a one-digit number is 9. The answer must also have less than 4 digits, because this is the AIME.
Case 1: The answer is a 2-digit number.
Represent the number as $10a + b$ , where $0 < a \leq 9$ and $0 \leq b \leq 9$ . The conditions of the problem translated into algebra are: \[17|10a+b\] \[a+b=17\] By the Euclidean Algorithm, this is equivalent to: \[17|9a\] 9 is not a factor of 17, so $17|a$ . So $a$ must be a multiple of 17, but this is impossible because of the conditions we placed on $a$ and $b$ .
(Alternatively, note that the only possible options are 89 and 98, and neither works.)
Case 2: The answer is a 3-digit number.
Represent the number as $100a+10b+c$ , where $0 < a \leq 9$ and $0 \leq b,c \leq 9$ . Translating the conditions again: \[17|100a+10b+c\] \[a+b+c=17\] \[17|99a+9b\] \[17|9(11a+b)\] \[17|11a+b\] Testing multiples of 17 yields $(4, 7, 6)$ as the minimal solution for $(a, b, c)$ and thus the answer is $\boxed{476}$

Answer:  476
Problem: In an isosceles trapezoid, the parallel bases have lengths $\log 3$ and $\log 192$ , and the altitude to these bases has length $\log 16$ . The perimeter of the trapezoid can be written in the form $\log 2^p 3^q$ , where $p$ and $q$ are positive integers. Find $p + q$

Solution: Call the trapezoid $ABCD$ with $AB$ as the smaller base and $CD$ as the longer. Let the point where an altitude intersects the larger base be $E$ , where $E$ is closer to $D$
Subtract the two bases and divide to find that $ED$ is $\log 8$ . The altitude can be expressed as $\frac{4}{3} \log 8$ . Therefore, the two legs are $\frac{5}{3} \log 8$ , or $\log 32$
The perimeter is thus $\log 32 + \log 32 + \log 192 + \log 3$ which is $\log 2^{16} 3^2$ . So $p + q = \boxed{018}$

Answer:  018
Problem: In an isosceles trapezoid, the parallel bases have lengths $\log 3$ and $\log 192$ , and the altitude to these bases has length $\log 16$ . The perimeter of the trapezoid can be written in the form $\log 2^p 3^q$ , where $p$ and $q$ are positive integers. Find $p + q$

Solution: Set the base of the log as 2. Then call the trapezoid $ABCD$ with $CD$ as the longer base. Then have the two feet of the altitudes be $E$ and $F$ , with $E$ and $F$ in position from left to right respectively. Then, $CF$ and $ED$ are $\log 192 - \log 3 = \log 64$ (from the log subtraction identity. Then $CF=EF=3$ (isosceles trapezoid and $\log 64$ being 6. Then the 2 legs of the trapezoid is $\sqrt{3^2+4^2}=5=\log 32$
And we have the answer:
$\log 192 + \log 32 + \log 32 + \log 3 = \log(192 \cdot 32 \cdot 32 \cdot 3) = \log(2^6 \cdot 3 \cdot 2^5 \cdot 2^5 \cdot 3) = \log(2^{16} \cdot 3^2) \Rightarrow 16+2 = \boxed{18}$

Answer:  18
Problem: In an isosceles trapezoid, the parallel bases have lengths $\log 3$ and $\log 192$ , and the altitude to these bases has length $\log 16$ . The perimeter of the trapezoid can be written in the form $\log 2^p 3^q$ , where $p$ and $q$ are positive integers. Find $p + q$

Solution: Let $ABCD$ be the trapezoid, where $\overline{AB} || \overline{CD}$ and $AB = \log 3$ and $CD = \log 192$ . Draw altitudes from $A$ and $B$ to $\overline{CD}$ with feet at $E$ and $F$ , respectively. $AB = \log 3$ , so $EF = \log 3$ . Now, we attempt to find $DE + FC$ , or what's left of $CD$ after we take out $EF$ . We make use of the two logarithmic rules:
\[\log(xy) = \log x + \log y\]
\[\log(x^a) = a\log(x)\]
\[CD = \log 192 = \log (3 \cdot 2^6) = \log 3 + \log(2^6) = \log 3 + 6\log 2\]
Thus, since $CD = DE + EF + FC = \log 3 + 6\log 2$ $CD - EF = \log 3 + 6\log 2 - \log 3 = 6\log 2 = DE + FC$
Now, why was finding $DE + FC$ important? Absolutely no reason! Just kidding, lol 🤣 Now, we essentially "glue" triangles $\triangle DAE$ and $\triangle BFC$ together to get $\triangle XC'D'$ , where $X$ is the point where $A$ and $B$ became one. Note we can do this because $\triangle DAE$ and $\triangle BFC$ are both right triangles with a common leg length (the altitude of trapezoid $ABCD$ ).
Triangle $XC'D'$ has a base of $C'D'$ , which is just equal to $DE + FC = 6\log 2$ . It is equal to $DE + FC$ because when we brought triangles $\triangle DAE$ and $\triangle BFC$ together, the length of $CD$ was not changed except for taking out $EF$
$XC' = XD'$ since $AD = BC$ because the problem tells us we have an isosceles trapezoid. Drop and altitude from $X$ to $C'D'$ The altitude has length $\log 16 = 4\log 2$ . The altitude also bisects $C'D'$ since $\triangle XC'D'$ is isosceles. Let the foot of the altitude be $M$ . Then $MD' = 3\log 2$ (Remember that C'D' was $6\log 2$ , and then it got bisected by the altitude). Thus, the hypotenuse, $XD'$ must be $5\log 2$ from the Pythagorean Theorem or by noticing that you have a 3-4-5 right triangle with a similarity ratio of $\log 2$ . Since $XD' = XC' = BC = AD$ $BC = AD = 5\log 2 = \log 2^5$
Now, we have $CD = \log (3 \cdot 2^6)$ $AB = \log 3$ , and $BC = AD = \log 2^5$ . Thus, their sum is
\[\log (3 \cdot 2^6) + \log 3 + \log 2^5 + \log 2^5 = \log (2^16 \cdot 3^2)\]
Thus, $p + q = 16 + 2 = \boxed{18}$ . ~Extremelysupercooldude

Answer:  18
Problem: Two unit squares are selected at random without replacement from an $n \times n$ grid of unit squares. Find the least positive integer $n$ such that the probability that the two selected unit squares are horizontally or vertically adjacent is less than $\frac{1}{2015}$

Solution: Call the given grid "Grid A". Consider Grid B, where the vertices of Grid B fall in the centers of the squares of Grid A; thus, Grid B has dimensions $(n-1) \times (n-1)$ . There is a one-to-one correspondence between the edges of Grid B and the number of adjacent pairs of unit squares in Grid A. The number of edges in Grid B is $2n(n-1)$ , and the number of ways to pick two squares out of Grid A is $\dbinom{n^2}{2}$ . So, the probability that the two chosen squares are adjacent is $\frac{2n(n-1)}{\binom{n^2}{2}} = \frac{2n(n-1)}{\frac{n^2(n^2-1)}{2}} = \frac{4}{n(n+1)}$ . We wish to find the smallest positive integer $n$ such that $\frac{4}{n(n+1)} < \frac{1}{2015}$ , and by inspection the first such $n$ is $\boxed{090}$

Answer:  090
Problem: Two unit squares are selected at random without replacement from an $n \times n$ grid of unit squares. Find the least positive integer $n$ such that the probability that the two selected unit squares are horizontally or vertically adjacent is less than $\frac{1}{2015}$

Solution: Consider a $3 \times 3$ grid, where there are $4$ corner squares, $4$ edge squares, and $1$ center square. A $4 \times 4$ grid has $4$ corner squares, $8$ edge squares, and $4$ center squares. By examining simple cases, we can conclude that for a grid that is $n \times n$ , there are always $4$ corners squares, $4(n-2)$ edge squares, and $n^2-4n+4$ center squares.
Each corner square is adjacent to $2$ other squares, edge squares to $3$ other squares, and center squares to $4$ other squares. In the problem, the second square can be any square that is not the first, which means there are $n^2-1$ to choose from. With this information, we can conclude that the probability that second unit square is adjacent to the first is $\frac{2}{n^2-1}(\frac{4}{n^2}) +\frac{3}{n^2-1}(\frac{4(n-2)}{n^2}) +\frac{4}{n^2-1}(\frac{n^2-4n+4}{n^2})$
Simplifying, we get $\frac{4}{n(n+1)}$ which we can set to be less than $\frac{1}{2015}$ . By inspection, we find that the first such $n$ is $\boxed{090}$

Answer:  090