Fix miss the Balkan 2021
Browse files
Balkan_MO/segment_script/segment_type1 .py
CHANGED
|
@@ -24,7 +24,7 @@ def analyze(text: str) -> Tuple[List, int]:
|
|
| 24 |
Returns:
|
| 25 |
Tuple[List, int]: A tuple containing the tags and problem number.
|
| 26 |
"""
|
| 27 |
-
problem_pattern = re.compile(r'(?:\n|# |## 2020 BMO\, )Problem\s+(\d+)(.)?', re.IGNORECASE)
|
| 28 |
solution_pattern = re.compile(r'(?:\n|# )Solution(?:\s+(\d+)|\.|\n|\:)', re.IGNORECASE)
|
| 29 |
|
| 30 |
tags = []
|
|
|
|
| 24 |
Returns:
|
| 25 |
Tuple[List, int]: A tuple containing the tags and problem number.
|
| 26 |
"""
|
| 27 |
+
problem_pattern = re.compile(r'(?:\n|# |## 2020 BMO\, |## BMO 2021 - )Problem\s+(\d+)(.)?', re.IGNORECASE)
|
| 28 |
solution_pattern = re.compile(r'(?:\n|# )Solution(?:\s+(\d+)|\.|\n|\:)', re.IGNORECASE)
|
| 29 |
|
| 30 |
tags = []
|
Balkan_MO/segmented/en-2021-BMO-type1.jsonl
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
{"year": "2021", "problem_label": "1", "
|
| 2 |
-
{"year": "2021", "problem_label": "1", "
|
| 3 |
-
{"year": "2021", "problem_label": "2", "
|
| 4 |
-
{"year": "2021", "problem_label": "2", "
|
| 5 |
-
{"year": "2021", "problem_label": "3", "
|
| 6 |
-
{"year": "2021", "problem_label": "4", "
|
| 7 |
-
{"year": "2021", "problem_label": "4", "
|
|
|
|
| 1 |
+
{"year": "2021", "tier": "T1", "problem_label": "1", "problem_type": null, "problem": "Let $A B C$ be a triangle with $A B<A C$. Let $\\omega$ be a circle passing through $B, C$ and assume that $A$ is inside $\\omega$. Suppose $X, Y$ lie on $\\omega$ such that $\\angle B X A=\\angle A Y C$. Suppose also that $X$ and $C$ lie on opposite sides of the line $A B$ and that $Y$ and $B$ lie on opposite sides of the line $A C$.\n\nShow that, as $X, Y$ vary on $\\omega$, the line $X Y$ passes through a fixed point.", "solution": ". Extend $X A$ and $Y A$ to meet $\\omega$ again at $X^{\\prime}$ and $Y^{\\prime}$ respectively. We then have that:\n\n$$\n\\angle Y^{\\prime} Y C=\\angle A Y C=\\angle B X A=\\angle B X X^{\\prime} .\n$$\n\nso $B C X^{\\prime} Y^{\\prime}$ is an isosceles trapezium and hence $X^{\\prime} Y^{\\prime} \\| B C$.\n\n\nLet $\\ell$ be the line through $A$ parallel to $B C$ and let $\\ell$ intersect $\\omega$ at $P, Q$ with $P$ on the opposite side of $A B$ to $C$. As $X^{\\prime} Y^{\\prime}\\|B C\\| P Q$ then\n\n$$\n\\angle X A P=\\angle X X^{\\prime} Y^{\\prime}=\\angle X Y Y^{\\prime}=\\angle X Y A\n$$\n\nwhich shows that $\\ell$ is tangent to the circumcircle of triangle $A X Y$. Let $X Y$ intersect $P Q$ at $Z$. By power of a point we have that\n\n$$\nZ A^{2}=Z X \\cdot Z Y=Z P \\cdot Z Q\n$$\n\nAs $P, Q$ are independent of the positions of $X, Y$, this shows that $Z$ is fixed and hence $X Y$ passes through a fixed point.", "metadata": {"resource_path": "Balkan_MO/segmented/en-2021-BMO-type1.jsonl", "problem_match": "## BMO 2021 - Problem 1", "solution_match": "\nSolution 1"}}
|
| 2 |
+
{"year": "2021", "tier": "T1", "problem_label": "1", "problem_type": null, "problem": "Let $A B C$ be a triangle with $A B<A C$. Let $\\omega$ be a circle passing through $B, C$ and assume that $A$ is inside $\\omega$. Suppose $X, Y$ lie on $\\omega$ such that $\\angle B X A=\\angle A Y C$. Suppose also that $X$ and $C$ lie on opposite sides of the line $A B$ and that $Y$ and $B$ lie on opposite sides of the line $A C$.\n\nShow that, as $X, Y$ vary on $\\omega$, the line $X Y$ passes through a fixed point.", "solution": ". Let $B^{\\prime}$ and $C^{\\prime}$ be the points of intersection of the lines $A B$ and $A C$ with $\\omega$ respectively and let $\\omega_{1}$ be the circumcircle of the triangle $A B^{\\prime} C^{\\prime}$. Let $\\varepsilon$ be the tangent to $\\omega_{1}$ at the point $A$. Because $A B<A C$ the lines $B^{\\prime} C^{\\prime}$ and $\\varepsilon$ intersects at a point $Z$ which is fixed and independent of $X$ and $Y$.\n\n\nWe have\n\n$$\n\\angle Z A C^{\\prime}=\\angle C^{\\prime} B^{\\prime} A=\\angle C^{\\prime} B^{\\prime} B=\\angle C^{\\prime} C B .\n$$\n\nTherefore, $\\varepsilon \\| B C$.\nLet $X^{\\prime}, Y^{\\prime}$ be the points of intersection of the lines $X A, Y A$ with $\\omega$ respecively. From the hypothesis we have $\\angle B X X^{\\prime}=\\angle Y^{\\prime} Y C$. Therefore\n\n$$\n\\widehat{B X^{\\prime}}=\\widehat{Y^{\\prime} C} \\Longrightarrow \\widehat{B C}+\\widehat{C X^{\\prime}}=\\widehat{Y^{\\prime} B}+\\widehat{B C} \\Longrightarrow \\widehat{C X^{\\prime}}=\\widehat{Y^{\\prime} B}\n$$\n\nand so $X^{\\prime} Y^{\\prime}\\|B C\\| \\varepsilon$. Thus\n\n$$\n\\angle X A Z=\\angle X X^{\\prime} Y^{\\prime}=\\angle X Y Y^{\\prime}=\\angle X Y A .\n$$\n\nFrom the last equality we have that $\\varepsilon$ is also tangent to the circmucircle $\\omega_{2}$ of the triangle $X A Y$.\n\nConsider now the radical centre of the circles $\\omega, \\omega_{1}, \\omega_{2}$. This is the point of intersection of the radical axes $B^{\\prime} C^{\\prime}\\left(\\right.$ of $\\omega$ and $\\left.\\omega_{1}\\right), \\varepsilon\\left(\\right.$ of $\\omega_{1}$ and $\\left.\\omega_{2}\\right)$ and $X Y$ (of $\\omega$ and $\\omega_{2}$ ).\nThis must be point $Z$ and therefore the variable line $X Y$ passes through the fixed point $Z$.", "metadata": {"resource_path": "Balkan_MO/segmented/en-2021-BMO-type1.jsonl", "problem_match": "## BMO 2021 - Problem 1", "solution_match": "\nSolution 2"}}
|
| 3 |
+
{"year": "2021", "tier": "T1", "problem_label": "2", "problem_type": null, "problem": "Find all functions $f:(0,+\\infty) \\rightarrow(0,+\\infty)$ such that\n\n$$\nf(x+f(x)+f(y))=2 f(x)+y\n$$\n\nholds for all $x, y \\in(0,+\\infty)$.", "solution": ". We will show that $f(x)=x$ for every $x \\in \\mathbb{R}^{+}$. It is easy to check that this function satisfies the equation.\n\nWe write $P(x, y)$ for the assertion that $f(x+f(x)+f(y))=2 f(x)+y$.\nWe first show that $f$ is injective. So assume $f(a)=f(b)$. Now $P(1, a)$ and $P(1, b)$ show that\n\n$$\n2 f(1)+a=f(1+f(1)+f(a))=f(1+f(1)+f(b))=2 f(1)+b\n$$\n\nand therefore $a=b$.\nLet $A=\\left\\{x \\in \\mathbb{R}^{+}: f(x)=x\\right\\}$. It is enough to show that $A=\\mathbb{R}^{+}$.\n$P(x, x)$ shows that $x+2 f(x) \\in A$ for every $x \\in \\mathbb{R}^{+}$. Now $P(x, x+2 f(x))$ gives that\n\n$$\nf(2 x+3 f(x))=x+4 f(x)\n$$\n\nfor every $x \\in \\mathbb{R}^{+}$. Therefore $P(x, 2 x+3 f(x))$ gives that $2 x+5 f(x) \\in A$ for every $x \\in \\mathbb{R}^{+}$. Suppose $x, y \\in \\mathbb{R}^{+}$such that $x, 2 x+y \\in A$. Then $P(x, y)$ gives that\n\n$$\nf(2 x+f(y))=f(x+f(x)+f(y))=2 f(x)+y=2 x+y=f(2 x+y)\n$$\n\nand by the injectivity of $f$ we have that $2 x+f(y)=2 x+y$. We conlude that $y \\in A$ as well. Now since $x+2 f(x) \\in A$ and $2 x+5 f(x)=2(x+2 f(x))+f(x) \\in A$ we deduce that $f(x) \\in A$ for every $x \\in \\mathbb{R}^{+}$. I.e. $f(f(x))=f(x)$ for every $x \\in \\mathbb{R}^{+}$.\nBy injectivity of $f$ we now conclude that $f(x)=x$ for every $x \\in \\mathbb{R}^{+}$.", "metadata": {"resource_path": "Balkan_MO/segmented/en-2021-BMO-type1.jsonl", "problem_match": "## BMO 2021 - Problem 2", "solution_match": "\nSolution 1"}}
|
| 4 |
+
{"year": "2021", "tier": "T1", "problem_label": "2", "problem_type": null, "problem": "Find all functions $f:(0,+\\infty) \\rightarrow(0,+\\infty)$ such that\n\n$$\nf(x+f(x)+f(y))=2 f(x)+y\n$$\n\nholds for all $x, y \\in(0,+\\infty)$.", "solution": ". As in Solution 1, $f$ is injective. Furthermore, letting $m=2 f(1)$ we have that the image of $f$ contains $(m, \\infty)$. Indeed, if $t>m$, say $t=m+y$ for some $y>0$, then $P(1, y)$ shows that $f(1+f(1)+f(y))=t$.\n\nLet $a, b \\in \\mathbb{R}$. We will show that $f(a)-a=f(b)-b$. Define $c=2 f(a)-2 f(b)$ and $d=a+f(a)-b-f(b)$. It is enough to show that $c=d$. By interchanging the roles of $a$ and $b$ in necessary, we may assume that $d \\geqslant 0$.\n\nFrom $P(a, y)$ and $P(b, y)$, after subtraction, we get\n\n$$\nf(a+f(a)+f(y))-f(b+f(b)+f(y))=2 f(a)-2 f(b)=c .\n$$\n\nso for any $t>m$ (picking $y$ such that $f(y)=t$ in (1)) we get\n\n$$\nf(a+f(a)+t)-f(b+f(b)+t)=2 f(a)-2 f(b)=c .\n$$\n\nNow for any $z>m+b+f(b)$, taking $t=z-b-f(b)$ in (2) we get\n\n$$\nf(z+d)-f(z)=c\n$$\n\nNow for any $x>m+b+f(b)$ from (3) we get that\n\n$$\n2 f(x+d)+y=2 f(x)+y+2 c\n$$\n\nAlso, for any $x$ large enough, $(x>\\max \\{m+b+f(b), m+b+f(b)+c-d\\}$ will do), by repeated application of (3), we have\n\n$$\n\\begin{aligned}\nf(x+d+f(x+d)+f(y)) & =f(x+f(x+d)+y)+c \\\\\n& =f(x+f(x)+y+c)+c \\\\\n& =f(x+f(x)+y+c-d)+2 c .\n\\end{aligned}\n$$\n\n(In the first equality we applied (3) with $z=x+f(x+d)+y>x>m+b+f(b)$, in the second with $z=x>m+b+f(b)$ and in the third with $z=x+f(x)+y-c+d>x+c-d>m+b+f(b)$.\n\nIn particular, now $P(x+d, y)$ implies that\n\n$$\nf(x+f(x)+y+c-d)=2 f(x)+y=f(x+f(x)+y)\n$$\n\nfor every large enough $x$. By injectivity of $f$ we deduce that $x+f(x)+y+c-d=x+f(x)+y$ and therefore $c=d$ as required.\n\nIt now follows that $f(x)=x+k$ for every $x \\in \\mathbb{R}^{+}$and some fixed constant $k$. Substituting in the initial equation we get $k=0$.", "metadata": {"resource_path": "Balkan_MO/segmented/en-2021-BMO-type1.jsonl", "problem_match": "## BMO 2021 - Problem 2", "solution_match": "\nSolution 2"}}
|
| 5 |
+
{"year": "2021", "tier": "T1", "problem_label": "3", "problem_type": null, "problem": "Let $a, b$ and $c$ be positive integers satisfying the equation\n\n$$\n(a, b)+[a, b]=2021^{c} .\n$$\n\nIf $|a-b|$ is a prime number, prove that the number $(a+b)^{2}+4$ is composite.\nHere, $(a, b)$ denotes the greatest common divisor of $a$ and $b$, and $[a, b]$ denotes the least common multiple of $a$ and $b$.", "solution": "We write $p=|a-b|$ and assume for contradiction that $q=(a+b)^{2}+4$ is a prime number.\n\nSince $(a, b) \\mid[a, b]$, we have that $(a, b) \\mid 2021^{c}$. As $(a, b)$ also divides $p=|a-b|$, it follows that $(a, b) \\in\\{1,43,47\\}$. We will consider all 3 cases separately:\n(1) If $(a, b)=1$, then $1+a b=2021^{c}$, and therefore\n\n$$\nq=(a+b)^{2}+4=(a-b)^{2}+4(1+a b)=p^{2}+4 \\cdot 2021^{c} .\n$$\n\n(a) Suppose $c$ is even. Since $q \\equiv 1 \\bmod 4$, it can be represented uniquely (up to order) as a sum of two (non-negative) squares. But (1) gives potentially two such representations so in order to have uniqueness we must have $p=2$. But then $4 \\mid q$ a contradiction.\n(b) If $c$ is odd then $a b=2021^{c}-1 \\equiv 1 \\bmod 3$. Thus $a \\equiv b \\bmod 3$ implying that $p=|a-b| \\equiv 0 \\bmod 3$. Therefore $p=3$. Without loss of generality $b=a+3$. Then $2021^{c}=a b+1=a^{2}+3 a+1$ and so\n\n$$\n(2 a+3)^{2}=4 a^{2}+12 a+9=4 \\cdot 2021^{c}+5\n$$\n\nSo 5 is a quadratic residue modulo 47, a contradiction as\n\n$$\n\\left(\\frac{5}{47}\\right)=\\left(\\frac{47}{5}\\right)=\\left(\\frac{2}{5}\\right)=-1 .\n$$\n\n(2) If $(a, b)=43$, then $p=|a-b|=43$ and we may assume that $a=43 k$ and $b=43(k+1)$, for some $k \\in \\mathbb{N}$. Then $2021^{c}=43+43 k(k+1)$ giving that\n\n$$\n(2 k+1)^{2}=4 k^{2}+4 k+4-3=4 \\cdot 43^{c-1} \\cdot 47-3 .\n$$\n\nSo -3 is a quadratic residue modulo 47 , a contradiction as\n\n$$\n\\left(\\frac{-3}{47}\\right)=\\left(\\frac{-1}{47}\\right)\\left(\\frac{3}{47}\\right)=\\left(\\frac{47}{3}\\right)=\\left(\\frac{2}{3}\\right)=-1\n$$\n\n(3) If $(a, b)=47$ then analogously there is a $k \\in \\mathbb{N}$ such that\n\n$$\n(2 k+1)^{2}=4 \\cdot 43^{c} \\cdot 47^{c-1}-3 .\n$$\n\nIf $c>1$ then we get a contradiction in exactly the same way as in (2). If $c=1$ then $(2 k+1)^{2}=169$ giving $k=6$. This implies that $a+b=47 \\cdot 6+47 \\cdot 7=47 \\cdot 13 \\equiv 1 \\bmod 5$. Thus $q=(a+b)^{2}+4 \\equiv 0 \\bmod 5$, a contradiction.", "metadata": {"resource_path": "Balkan_MO/segmented/en-2021-BMO-type1.jsonl", "problem_match": "## BMO 2021 - Problem 3", "solution_match": "\nSolution."}}
|
| 6 |
+
{"year": "2021", "tier": "T1", "problem_label": "4", "problem_type": null, "problem": "Angel has a warehouse, which initially contains 100 piles of 100 pieces of rubbish each. Each morning, Angel performs exactly one of the following moves:\n(a) He clears every piece of rubbish from a single pile.\n(b) He clears one piece of rubbish from each pile.\n\nHowever, every evening, a demon sneaks into the warehouse and performs exactly one of the following moves:\n(a) He adds one piece of rubbish to each non-empty pile.\n(b) He creates a new pile with one piece of rubbish.\n\nWhat is the first morning when Angel can guarantee to have cleared all the rubbish from the warehouse?", "solution": ". We will show that he can do so by the morning of day 199 but not earlier.If we have $n$ piles with at least two pieces of rubbish and $m$ piles with exactly one piece of rubbish, then we define the value of the pile to be\n\n$$\nV= \\begin{cases}n & m=0 \\\\ n+\\frac{1}{2} & m=1 \\\\ n+1 & m \\geqslant 2\\end{cases}\n$$\n\nWe also denote this position by $(n, m)$. Implicitly we will also write $k$ for the number of piles with exactly two pieces of rubbish.\n\nAngel's strategy is the following:\n(i) From position $(0, m)$ remove one piece from each pile to go position $(0,0)$. The game ends.\n(ii) From position $(n, 0)$, where $n \\geqslant 1$, remove one pile to go to position $(n-1,0)$. Either the game ends, or the demon can move to position $(n-1,0)$ or $(n-1,1)$. In any case $V$ reduces by at least $1 / 2$.\n(iii) From position $(n, 1)$, where $n \\geqslant 1$, remove one pile with at least two pieces to go to position $(n-1,1)$. The demon can move to position $(n, 0)$ or $(n-1,2)$. In any case $V$ reduces by (at least) $1 / 2$.\n(iv) From position $(n, m)$, where $n \\geqslant 1$ and $m \\geqslant 2$, remove one piece from each pile to go to position $(n-k, k)$. The demon can move to position $(n, 0)$ or $(n-k, k+1)$. In any case $V$ reduces by at least $1 / 2$. (The value of position $(n-k, k+1)$ is $n+\\frac{1}{2}$ if $k=0$, and $n-k+1 \\leqslant n$ if $k \\geqslant 1$.)\nSo during every day if the game does not end then $V$ is decreased by at least $1 / 2$. So after 198 days if the game did not already end we will have $V \\leqslant 1$ and we will be in one of positions $(0, m),(1,0)$. The game can then end on the morning of day 199.\nWe will now provide a strategy for demon which guarantees that at the end of each day $V$ has decreased by at most $1 / 2$ and furthermore at the end of the day $m \\leqslant 1$.\n(i) If Angel moves from $(n, 0)$ to $(n-1,0)$ (by removing a pile) then create a new pile with one piece to move to $(n-1,1)$. Then $V$ decreases by $1 / 2$ and and $m=1 \\leqslant 1$\n(ii) If Angel moves from $(n, 0)$ to $(n-k, k)$ (by removing one piece from each pile) then add one piece back to each pile to move to $(n, 0)$. Then $V$ stays the same and $m=0 \\leqslant 1$.\n(iii) If Angels moves from $(n, 1)$ to $(n-1,1)$ or $(n, 0)$ (by removing a pile) then add one piece to each pile to move to $(n, 0)$. Then $V$ decreases by $1 / 2$ and $m=0 \\leqslant 1$.\n(iv) If Angel moves from $(n, 1)$ to $(n-k, k)$ (by removing a piece from each pile) then add one piece to each pile to move to $(n, 0)$. Then $V$ decreases by $1 / 2$ and $m=0 \\leqslant 1$.\nSince after every move of demon we have $m \\leqslant 1$, in order for Angel to finish the game in the next morning we must have $n=1, m=0$ or $n=0, m=1$ and therefore we must have $V \\leqslant 1$. But now inductively the demon can guarantee that by the end of day $N$, where $N \\leqslant 198$ the game has not yet finished and that $V \\geqslant 100-N / 2$.", "metadata": {"resource_path": "Balkan_MO/segmented/en-2021-BMO-type1.jsonl", "problem_match": "## BMO 2021 - Problem 4", "solution_match": "\nSolution 1"}}
|
| 7 |
+
{"year": "2021", "tier": "T1", "problem_label": "4", "problem_type": null, "problem": "Angel has a warehouse, which initially contains 100 piles of 100 pieces of rubbish each. Each morning, Angel performs exactly one of the following moves:\n(a) He clears every piece of rubbish from a single pile.\n(b) He clears one piece of rubbish from each pile.\n\nHowever, every evening, a demon sneaks into the warehouse and performs exactly one of the following moves:\n(a) He adds one piece of rubbish to each non-empty pile.\n(b) He creates a new pile with one piece of rubbish.\n\nWhat is the first morning when Angel can guarantee to have cleared all the rubbish from the warehouse?", "solution": ".\n\nDefine Angel's score $S_{A}$ to be $S_{A}=2 n+m-1$. The Angel can clear the rubbish in at most $\\max \\left\\{S_{A}, 1\\right\\}$ days. The proof is by induction on $(n, m)$ in lexicographic order.\n\nAngel's strategy is the same as in Solution 1 and in each of cases (ii)-(iv) one needs to check that $S_{A}$ reduces by at least 1 in each day. (Case (i) is trivial as the game ends in one day.)\n\nNow define demon's score $S_{D}$ to be $S_{D}=2 n-1$ if $m=0$ and $S_{D}=2 n$ if $m \\geqslant 1$. The claim is the if $(n, m) \\neq(0,0)$, then the demon can ensure that Angel requires $S_{D}$ days to clear the rubbish.\n\nAgain, demon's strategy is the same as in the Solution by PSC and in each of cases (i)-(iv) one needs to check that $S_{D}$ reduced by at most 1 in each day.", "metadata": {"resource_path": "Balkan_MO/segmented/en-2021-BMO-type1.jsonl", "problem_match": "## BMO 2021 - Problem 4", "solution_match": "# Solution 2"}}
|