di-zhang-fdu/OlympiadExtended huggingface dataset:
Subfield: Combinatorics


Question: Elizabeth is in an "escape room" puzzle. She is in a room with one door which is locked at the start of the puzzle. The room contains $n$ light switches, each of which is initially off. Each minute, she must flip exactly $k$ different light switches (to "flip" a switch means to turn it on if it is currently off, and off if it is currently on). At the end of each minute, if all of the switches are on, then the door unlocks and Elizabeth escapes from the room.

Let $E(n, k)$ be the minimum number of minutes required for Elizabeth to escape, for positive integers $n, k$ with $k \leq n$. For example, $E(2,1)=2$ because Elizabeth cannot escape in one minute (there are two switches and one must be flipped every minute) but she can escape in two minutes (by flipping Switch 1 in the first minute and Switch 2 in the second minute). Define $E(n, k)=\infty$ if the puzzle is impossible to solve (that is, if it is impossible to have all switches on at the end of any minute).

For convenience, assume the $n$ light switches are numbered 1 through $n$.
Find an integer value of $k$ with $1<k<2019$ such that $E(2019, k)=\infty$.

Solution:
The answer is that $k$ can be any even number between 2 and 2018 inclusive. If Elizabeth escapes, each switch must have been flipped an odd number of times. Because there are 2019 switches, the total number of flips must be odd. However, if an even number of flips are performed each minute, then the total number of flips cannot be odd. Therefore the puzzle is impossible, and $E(2019, k)=\infty$.
Consider the number of lights that are on after each minute. Flipping an even number of switches either leaves this number unchanged, or increases or decreases it by an even number. Because the puzzle starts with 0 lights on, and 2019 is odd, it is impossible to have 2019 lights on at the end of any minute. Thus $E(2019, k)=\infty$.

Final answer: any even number between 2 and 2018 inclusive
Subfield: Combinatorics


Question: Elizabeth is in an "escape room" puzzle. She is in a room with one door which is locked at the start of the puzzle. The room contains $n$ light switches, each of which is initially off. Each minute, she must flip exactly $k$ different light switches (to "flip" a switch means to turn it on if it is currently off, and off if it is currently on). At the end of each minute, if all of the switches are on, then the door unlocks and Elizabeth escapes from the room.

Let $E(n, k)$ be the minimum number of minutes required for Elizabeth to escape, for positive integers $n, k$ with $k \leq n$. For example, $E(2,1)=2$ because Elizabeth cannot escape in one minute (there are two switches and one must be flipped every minute) but she can escape in two minutes (by flipping Switch 1 in the first minute and Switch 2 in the second minute). Define $E(n, k)=\infty$ if the puzzle is impossible to solve (that is, if it is impossible to have all switches on at the end of any minute).

For convenience, assume the $n$ light switches are numbered 1 through $n$.
Show that if $n+k$ is even and $\frac{n}{2}<k<n$, then $E(n, k)=3$.

Solution:
First, because $k<n$, not all switches can be flipped in one minute, and so $E(n, k) \neq 1$. Second, because $k>\frac{n}{2}$, some switches must be flipped twice in the first two minutes, and so $E(n, k) \neq 2$.

Here is a strategy by which Elizabeth can escape in three minutes. Note that because $n+k$ is even, it follows that $3 k-n=(k+n)+2(k-n)$ is also even. Then let $3 k-n=2 b$. Note that $b>0$ (because $k>\frac{n}{2}$ ), and $b<k$ (because $k<n$ ).

Elizabeth's strategy is to flip switches 1 through $b$ three times each, and the remaining $n-b$ switches once each. This is possible because $n-b=(3 k-2 b)-b=3(k-b)$ is divisible by 3 , and $b+\frac{n-b}{3}=b+(k-b)=k$. Therefore, each minute, Elizabeth can flip switches 1 through $b$, and one-third of the $3(k-b)$ switches from $b+1$ through $n$. This allows her to escape in three minutes, as desired.
Subfield: Combinatorics


Question: Elizabeth is in an "escape room" puzzle. She is in a room with one door which is locked at the start of the puzzle. The room contains $n$ light switches, each of which is initially off. Each minute, she must flip exactly $k$ different light switches (to "flip" a switch means to turn it on if it is currently off, and off if it is currently on). At the end of each minute, if all of the switches are on, then the door unlocks and Elizabeth escapes from the room.

Let $E(n, k)$ be the minimum number of minutes required for Elizabeth to escape, for positive integers $n, k$ with $k \leq n$. For example, $E(2,1)=2$ because Elizabeth cannot escape in one minute (there are two switches and one must be flipped every minute) but she can escape in two minutes (by flipping Switch 1 in the first minute and Switch 2 in the second minute). Define $E(n, k)=\infty$ if the puzzle is impossible to solve (that is, if it is impossible to have all switches on at the end of any minute).

For convenience, assume the $n$ light switches are numbered 1 through $n$.
Show that if $n$ is even and $k$ is odd, then $E(n, k)=E(n,n-k)$.

Solution:
Because $n$ is even, and because each switch must be flipped an odd number of times in order to escape, the total number of flips is even. Because $k$ must be odd, $E(n, k)$ must be even. To show this, consider the case where $E(n, k)$ is odd. If $E(n, k)$ is odd, then an odd number of flips happen an odd number of times, resulting in an odd number of total flips. This is a contradiction because $n$ is even.

Call a switch "non-flipped" in any given minute if it is not among the switches flipped in that minute. Because $E(n, k)$ (i.e., the total number of minutes) is even, and each switch is flipped an odd number of times, each switch must also be non-flipped an odd number of times. Therefore any sequence of flips that solves the " $(n, k)$ puzzle" can be made into a sequence of flips that solves the " $(n, n-k)$ " puzzle by interchanging flips and non-flips. These sequences last for the same number of minutes, and therefore $E(n, k)=E(n, n-k)$.
Subfield: Combinatorics


Question: Elizabeth is in an "escape room" puzzle. She is in a room with one door which is locked at the start of the puzzle. The room contains $n$ light switches, each of which is initially off. Each minute, she must flip exactly $k$ different light switches (to "flip" a switch means to turn it on if it is currently off, and off if it is currently on). At the end of each minute, if all of the switches are on, then the door unlocks and Elizabeth escapes from the room.

Let $E(n, k)$ be the minimum number of minutes required for Elizabeth to escape, for positive integers $n, k$ with $k \leq n$. For example, $E(2,1)=2$ because Elizabeth cannot escape in one minute (there are two switches and one must be flipped every minute) but she can escape in two minutes (by flipping Switch 1 in the first minute and Switch 2 in the second minute). Define $E(n, k)=\infty$ if the puzzle is impossible to solve (that is, if it is impossible to have all switches on at the end of any minute).

For convenience, assume the $n$ light switches are numbered 1 through $n$.
Find the $E(2020,1993)$

Solution:
First, we prove that if $n$ is even and $k$ is odd, then $E(n, k)=E(n,n-k)$.


Because $n$ is even, and because each switch must be flipped an odd number of times in order to escape, the total number of flips is even. Because $k$ must be odd, $E(n, k)$ must be even. To show this, consider the case where $E(n, k)$ is odd. If $E(n, k)$ is odd, then an odd number of flips happen an odd number of times, resulting in an odd number of total flips. This is a contradiction because $n$ is even.

Call a switch "non-flipped" in any given minute if it is not among the switches flipped in that minute. Because $E(n, k)$ (i.e., the total number of minutes) is even, and each switch is flipped an odd number of times, each switch must also be non-flipped an odd number of times. Therefore any sequence of flips that solves the " $(n, k)$ puzzle" can be made into a sequence of flips that solves the " $(n, n-k)$ " puzzle by interchanging flips and non-flips. These sequences last for the same number of minutes, and therefore $E(n, k)=E(n, n-k)$.

$E(2020,1993)=76$. By the above prove, conclude that $E(2020,1993)=E(2020,27)$. Compute the latter instead. Because $\frac{2020}{27}>74$, it will require at least 75 minutes to flip each switch once. Furthermore, $E(2020,27) \geq 76$ because the prove above implies that $E(2020,27)$ is even.

To solve the puzzle in exactly 76 minutes, use the following strategy. For the first 33 minutes, flip switch 1, along with the first 26 switches that have not yet been flipped. The end result is that lights 1 through $26 \cdot 33+1=859$ are on, and the remaining 1161 lights are off. Note that $1161=27 \cdot 43$, so it takes 43 minutes to flip each remaining switch exactly once, for a total of 76 minutes, as desired.

Final answer: 76
Subfield: Combinatorics


Question: Elizabeth is in an "escape room" puzzle. She is in a room with one door which is locked at the start of the puzzle. The room contains $n$ light switches, each of which is initially off. Each minute, she must flip exactly $k$ different light switches (to "flip" a switch means to turn it on if it is currently off, and off if it is currently on). At the end of each minute, if all of the switches are on, then the door unlocks and Elizabeth escapes from the room.

Let $E(n, k)$ be the minimum number of minutes required for Elizabeth to escape, for positive integers $n, k$ with $k \leq n$. For example, $E(2,1)=2$ because Elizabeth cannot escape in one minute (there are two switches and one must be flipped every minute) but she can escape in two minutes (by flipping Switch 1 in the first minute and Switch 2 in the second minute). Define $E(n, k)=\infty$ if the puzzle is impossible to solve (that is, if it is impossible to have all switches on at the end of any minute).

For convenience, assume the $n$ light switches are numbered 1 through $n$.
Find the $E(2001,501)$

Solution:
$E(2001,501)=5$. First, note that three minutes is not enough time to flip each switch once. In four minutes, Elizabeth can flip each switch once, but has three flips left over. Because there are an odd number of leftover flips to distribute among the 2001 switches, some switch must get an odd number of leftover flips, and thus an even number of total flips. Thus $E(2001,501)>4$.

To solve the puzzle in five minutes, Elizabeth can flip the following sets of switches:

- in the first minute, $\{1,2,3, \ldots, 501\}$;
- in the second minute, $\{1,2,3, \ldots, 102\}$ and $\{502,503,504, \ldots, 900\}$;
- in the third minute, $\{1,2,3, \ldots, 102\}$ and $\{901,902,903, \ldots, 1299\}$;
- in the fourth minute, $\{1,2,3, \ldots, 100\}$ and $\{1300,1301,1302, \ldots, 1700\}$;
- in the fifth minute, $\{1,2,3, \ldots, 100\}$ and $\{1701,1702,1703, \ldots, 2001\}$.

This results in switches $1,2,3, \ldots, 100$ being flipped five times, switches 101 and 102 being flipped three times, and the remaining switches being flipped exactly once, so that all the lights are on at the end of the fifth minute.

Final answer: 5
Subfield: Combinatorics


Question: Elizabeth is in an "escape room" puzzle. She is in a room with one door which is locked at the start of the puzzle. The room contains $n$ light switches, each of which is initially off. Each minute, she must flip exactly $k$ different light switches (to "flip" a switch means to turn it on if it is currently off, and off if it is currently on). At the end of each minute, if all of the switches are on, then the door unlocks and Elizabeth escapes from the room.

Let $E(n, k)$ be the minimum number of minutes required for Elizabeth to escape, for positive integers $n, k$ with $k \leq n$. For example, $E(2,1)=2$ because Elizabeth cannot escape in one minute (there are two switches and one must be flipped every minute) but she can escape in two minutes (by flipping Switch 1 in the first minute and Switch 2 in the second minute). Define $E(n, k)=\infty$ if the puzzle is impossible to solve (that is, if it is impossible to have all switches on at the end of any minute).

For convenience, assume the $n$ light switches are numbered 1 through $n$.
Show that if $n$ and $k$ are both even and $k \leq \frac{n}{2}$, then $E(n, k)=\left\lceil\frac{n}{k}\right\rceil$.

Solution:
First, if $k$ divides $n$, then $E(n, k)=\frac{n}{k}=\left\lceil\frac{n}{k}\right\rceil$. Assume then that $k$ does not divide $n$. Then let $r=\left\lceil\frac{n}{k}\right\rceil$, which implies $(r-1) k<n<r k$.

Because $(r-1) k<n$, it follows that $r-1$ minutes are not enough to flip each switch once, so $E(n, k) \geq r$.

Because $n$ and $k$ are even, it follows that $r k$ and $r k-n$ are also even. Then $r k-n=2 b$ for some integer $b \geq 1$, and note that $b<k$ because $r k-k<n$. Then the following strategy turns all of the lights on in $r$ minutes.

- In each of the first three minutes, flip switches 1 through $b$, along with the next $k-b$ switches that have not yet been flipped. This leaves $b+3(k-b)$ lights on, and the rest off. Note that $b+3(k-b)=3 k-2 b=3 k-(r k-n)=n-k(r-3)$.
- In each of the remaining $r-3$ minutes, flip the first $k$ switches that have never been flipped before.

This strategy turns on the remaining $k(r-3)$ lights, and Elizabeth escapes the room after $r$ minutes.
Subfield: Combinatorics


Question: Elizabeth is in an "escape room" puzzle. She is in a room with one door which is locked at the start of the puzzle. The room contains $n$ light switches, each of which is initially off. Each minute, she must flip exactly $k$ different light switches (to "flip" a switch means to turn it on if it is currently off, and off if it is currently on). At the end of each minute, if all of the switches are on, then the door unlocks and Elizabeth escapes from the room.

Let $E(n, k)$ be the minimum number of minutes required for Elizabeth to escape, for positive integers $n, k$ with $k \leq n$. For example, $E(2,1)=2$ because Elizabeth cannot escape in one minute (there are two switches and one must be flipped every minute) but she can escape in two minutes (by flipping Switch 1 in the first minute and Switch 2 in the second minute). Define $E(n, k)=\infty$ if the puzzle is impossible to solve (that is, if it is impossible to have all switches on at the end of any minute).

For convenience, assume the $n$ light switches are numbered 1 through $n$.
One might guess that in most cases, $E(n, k) \approx \frac{n}{k}$. In light of this guess, define the inefficiency of the ordered pair $(n, k)$, denoted $I(n, k)$, as

$$
I(n, k)=E(n, k)-\frac{n}{k}
$$

if $E(n, k) \neq \infty$. If $E(n, k)=\infty$, then by convention, $I(n, k)$ is undefined.

Compute $I(6,3)$.

Solution:
$I(6,3)=0$. By definition, $I(6,3)=E(6,3)-\frac{6}{3}$. Because $3 \mid 6, E(6,3)=\frac{6}{3}=2$, and so $I(6,3)=2-2=0$.

Final answer: 0
Subfield: Combinatorics


Question: Elizabeth is in an "escape room" puzzle. She is in a room with one door which is locked at the start of the puzzle. The room contains $n$ light switches, each of which is initially off. Each minute, she must flip exactly $k$ different light switches (to "flip" a switch means to turn it on if it is currently off, and off if it is currently on). At the end of each minute, if all of the switches are on, then the door unlocks and Elizabeth escapes from the room.

Let $E(n, k)$ be the minimum number of minutes required for Elizabeth to escape, for positive integers $n, k$ with $k \leq n$. For example, $E(2,1)=2$ because Elizabeth cannot escape in one minute (there are two switches and one must be flipped every minute) but she can escape in two minutes (by flipping Switch 1 in the first minute and Switch 2 in the second minute). Define $E(n, k)=\infty$ if the puzzle is impossible to solve (that is, if it is impossible to have all switches on at the end of any minute).

For convenience, assume the $n$ light switches are numbered 1 through $n$.
One might guess that in most cases, $E(n, k) \approx \frac{n}{k}$. In light of this guess, define the inefficiency of the ordered pair $(n, k)$, denoted $I(n, k)$, as

$$
I(n, k)=E(n, k)-\frac{n}{k}
$$

if $E(n, k) \neq \infty$. If $E(n, k)=\infty$, then by convention, $I(n, k)$ is undefined.

Prove that for any integer $x>2$, there exists an ordered pair $(n, k)$ for which $I(n, k)>x$.

Solution:
First, we prove that if $n$ is even and $k$ is odd, then $E(n, k)=E(n,n-k)$.


Because $n$ is even, and because each switch must be flipped an odd number of times in order to escape, the total number of flips is even. Because $k$ must be odd, $E(n, k)$ must be even. To show this, consider the case where $E(n, k)$ is odd. If $E(n, k)$ is odd, then an odd number of flips happen an odd number of times, resulting in an odd number of total flips. This is a contradiction because $n$ is even.

Call a switch "non-flipped" in any given minute if it is not among the switches flipped in that minute. Because $E(n, k)$ (i.e., the total number of minutes) is even, and each switch is flipped an odd number of times, each switch must also be non-flipped an odd number of times. Therefore any sequence of flips that solves the " $(n, k)$ puzzle" can be made into a sequence of flips that solves the " $(n, n-k)$ " puzzle by interchanging flips and non-flips. These sequences last for the same number of minutes, and therefore $E(n, k)=E(n, n-k)$.


Let $n=2 x$ and $k=2 x-1$ for some positive integer $x$. Then $n$ is even and $k$ is odd, so the above prove applies, and $E(n, k)=E(n, n-k)=E(n, 1)=2 x$. Therefore $I(n, k)=2 x-\frac{2 x}{2 x-1}$. Because $x>2$, it follows that $\frac{2 x}{2 x-1}<2<x$, so $I(n, k)>x$, as desired.
Subfield: Geometry


Question: Regular tetrahedra $J A N E, J O H N$, and $J O A N$ have non-overlapping interiors. Compute $\tan \angle H A E$.

Solution:
First note that $\overline{J N}$ is a shared edge of all three pyramids, and that the viewpoint for the figure below is from along the line that is the extension of edge $\overline{J N}$.

<img_3460>

Let $h$ denote the height of each pyramid. Let $X$ be the center of pyramid JOAN, and consider the plane passing through $H, A$, and $E$. By symmetry, the altitude in pyramid $J O H N$ through $H$ and the altitude in pyramid $J A N E$ through $E$ pass through $X$. Thus points $H, X$, and $A$ are collinear, as are points $E, X$, and $O$. Hence $A H=O E=2 h$. Using the result that the four medians in a tetrahedron are concurrent and divide each other in a $3: 1$ ratio, it follows that $A X=O X=\frac{3 h}{4}$ and $X E=O E-O X=\frac{5 h}{4}$. Applying the Law of Cosines to triangle $A X E$ yields $\cos \angle X A E=\cos \angle H A E=\frac{2-2 h^{2}}{3 h}$. Suppose, without loss of generality, that the common side length of the pyramids is 1 . Then $h=\sqrt{\frac{2}{3}}$ and $\cos \angle H A E=\frac{\sqrt{6}}{9}$. Hence $\sin \angle H A E=\frac{\sqrt{75}}{9}$ and therefore $\tan \angle H A E=\frac{5 \sqrt{2}}{\mathbf{2}}$.

Final answer: $\frac{5 \sqrt{2}}{2}$
Subfield: Number Theory


Question: Each positive integer less than or equal to 2019 is written on a blank sheet of paper, and each of the digits 0 and 5 is erased. Compute the remainder when the product of the remaining digits on the sheet of paper is divided by 1000 .

Solution:
Count the digits separately by position, noting that 1 is irrelevant to the product. There are a total of 20 instances of the digit 2 in the thousands place. The digit 0 only occurs in the hundreds place if the thousands digit is 2 , so look at the numbers 1 through 1999. Each non-zero digit contributes an equal number of times, so there are 200 each of $1,2,3,4,6,7,8,9$. The same applies to the tens digit, except there can be the stray digit of 1 among the numbers 2010 through 2019, but again, these do not affect the product. In the units place, there are 202 of each of the digits. Altogether, there are 602 each of $2,3,4,6,7,8$, 9, along with 20 extra instances of the digit 2 . Note that $9 \cdot 8 \cdot 7 \cdot 6 \cdot 4 \cdot 3 \cdot 2=3024 \cdot 24=72,576$ leaves a remainder of 576 when divided by 1000 . Also $2^{20}=1024^{2} \equiv 24^{2}(\bmod 1000)$, so $2^{20}$ contributes another factor of 576 . The answer is therefore the remainder when $576^{603}$ is divided by 1000 . This computation can be simplified by using the Chinese Remainder Theorem with moduli 8 and 125 , whose product is 1000 . Note $576^{603} \equiv 0(\bmod 8)$ because 576 is divisible by 8 . Also $576 \equiv 76(\bmod 125)$. By Euler's totient theorem, $576^{100} \equiv 1(\bmod 125)$, so $576^{603} \equiv 76^{3}(\bmod 125)$. This can quickly be computed by noting that $76^{3}=(75+1)^{3}=75^{3}+3 \cdot 75^{2}+3 \cdot 75+1 \equiv 3 \cdot 75+1 \equiv-24(\bmod 125)$. Observing that $-24 \equiv 0(\bmod 8)$, it follows that $576^{603} \equiv-24(\bmod 1000)$, hence the desired remainder is 976 .

Final answer: 976
Subfield: Number Theory


Question: Compute the third least positive integer $n$ such that each of $n, n+1$, and $n+2$ is a product of exactly two (not necessarily distinct) primes.

Solution:
Define a positive integer $n$ to be a semiprime if it is a product of exactly two (not necessarily distinct) primes. Define a lucky trio to be a sequence of three consecutive integers, $n, n+1, n+2$, each of which is a semiprime. Note that a lucky trio must contain exactly one multiple of 3. Also note that the middle number in a lucky trio must be even. To see this, note that if the first and last numbers in a lucky trio were both even, then exactly one of these numbers would be a multiple of 4 . But neither $2,3,4$ nor 4,5,6 is a lucky trio, and if a list of three consecutive integers contains a multiple of 4 that is greater than 4 , this number cannot be a semiprime. Using this conclusion and because $3,4,5$ is not a lucky trio, it follows that the middle number of a lucky trio cannot be a multiple of 4 . Hence it is necessary that a lucky trio has the form $4 k+1,4 k+2,4 k+3$, for some positive integer $k$, with $2 k+1$ being a prime. Note that $k \neq 1(\bmod 3)$ because when $k=1$, the sequence $5,6,7$ is not a lucky trio, and when $k>1,4 k+2$ would be a multiple of 6 greater than 6 , hence it cannot be a semiprime. Trying $k=2,3,5,6,8,9, \ldots$ allows one to eliminate sequences of three consecutive integers that are not lucky trios, and if lucky trios are ordered by their least elements, one finds that the first three lucky trios are 33,34,35; 85,86,87; and 93,94,95. Hence the answer is 93.

Final answer: 93
Subfield: Geometry


Question: The points $(1,2,3)$ and $(3,3,2)$ are vertices of a cube. Compute the product of all possible distinct volumes of the cube.

Solution:
The distance between points $A(1,2,3)$ and $B(3,3,2)$ is $A B=\sqrt{(3-1)^{2}+(3-2)^{2}+(2-3)^{2}}=\sqrt{6}$. Denote by $s$ the side length of the cube. Consider three possibilities.

- If $\overline{A B}$ is an edge of the cube, then $A B=s$, so one possibility is $s_{1}=\sqrt{6}$.
- If $\overline{A B}$ is a face diagonal of the cube, then $A B=s \sqrt{2}$, so another possibility is $s_{2}=\sqrt{3}$.
- If $\overline{A B}$ is a space diagonal of the cube, then $A B=s \sqrt{3}$, so the last possibility is $s_{3}=\sqrt{2}$.

The answer is then $s_{1}^{3} s_{2}^{3} s_{3}^{3}=\left(s_{1} s_{2} s_{3}\right)^{3}=6^{3}=\mathbf{2 1 6}$.

Final answer: 216