{"year": "1998", "tier": "T3", "problem_label": "1", "problem_type": null, "exam": "BalticWay", "problem": "Let $\\mathbb{Z}^{+}$be the set of all positive integers. Find all functions $f: \\mathbb{Z}^{+} \\rightarrow \\mathbb{Z}^{+}$ satisfying the following conditions for all $x, y \\in \\mathbb{Z}^{+}$:\n\n$$\n\\begin{aligned}\nf(x, x) & =x, \\\\\nf(x, y) & =f(y, x), \\\\\n(x+y) f(x, y) & =y f(x, x+y) .\n\\end{aligned}\n$$", "solution": "Answer: $f(x, y)=\\operatorname{lcm}(x, y)$ is the only such function.\n\nWe first show that there is at most one such function $f$. Let $z \\geqslant 2$ be an integer. Knowing the values $f(x, y)$ for all $x, y$ with $01$ satisfies (1), then so does the reduced triple $\\left(\\frac{a}{d}, \\frac{b}{d}, \\frac{c}{d}\\right)$. Hence it suffices to prove that in every irreducible quasi-Pythagorean triple the greatest term $c$ has a prime divisor greater than 5. Actually, we will show that in that case every prime divisor of $c$ is greater than 5 .\n\nLet $(a, b, c)$ be an irreducible triple satisfying (1). Note that then $a, b$ and $c$ are pairwise coprime. We have to show that $c$ is not divisible by 2,3 or 5 .\n\nIf $c$ were even, then $a$ and $b$ (coprime to $c$ ) should be odd, and (1) would not hold.\n\nSuppose now that $c$ is divisible by 3 , and rewrite (1) as\n\n$$\n4 c^{2}=(a+2 b)^{2}+3 a^{2}\n$$\n\nThen $a+2 b$ must be divisible by 3 . Since $a$ is coprime to $c$, the number $3 a^{2}$ is not divisible by 9 . This yields a contradiction since the remaining terms in (2) are divisible by 9 .\n\nFinally, suppose $c$ is divisible by 5 (and hence $a$ is not). Again we get a contradiction with (2) since the square of every integer is congruent to 0 ,\n\n1 or -1 modulo 5 ; so $4 c^{2}-3 a^{2} \\equiv \\pm 2(\\bmod 5)$ and it cannot be equal to $(a+2 b)^{2}$. This completes the proof.\n\nRemark. A yet stronger claim is true: If $a$ and $b$ are coprime, then every prime divisor $p>3$ of $a^{2}+a b+b^{2}$ is of the form $p=6 k+1$. (Hence every prime divisor of $c$ in an irreducible quasi-Pythagorean triple $(a, b, c)$ has such a form.)\n\nThis stronger claim can be proved by observing that $p$ does not divide $a$ and the number $g=(a+2 b) a^{(p-3) / 2}$ is an integer whose square satisfies\n\n$$\n\\begin{aligned}\ng^{2} & =(a+2 b)^{2} a^{p-3}=\\left(4\\left(a^{2}+a b+b^{2}\\right)-3 a^{2}\\right) a^{p-3} \\equiv-3 a^{p-1} \\equiv \\\\\n& \\equiv-3(\\bmod p)\n\\end{aligned}\n$$\n\nHence -3 is a quadratic residue modulo $p$. This is known to be true only for primes of the form $6 k+1$; proofs can be found in many books on number theory, e.g. [1].\n\nReference. [1] K. Ireland, M. Rosen, A Classical Introduction to Modern Number Theory, Second Edition, Springer-Verlag, New York 1990.", "metadata": {"resource_path": "BalticWay/segmented/en-bw98sol.jsonl", "problem_match": "\n2.", "solution_match": "\n2."}} {"year": "1998", "tier": "T3", "problem_label": "3", "problem_type": null, "exam": "BalticWay", "problem": "Find all pairs of positive integers $x, y$ which satisfy the equation\n\n$$\n2 x^{2}+5 y^{2}=11(x y-11) \\text {. }\n$$", "solution": "Answer: $x=14, y=27$.\n\nRewriting the equation as $2 x^{2}-x y+5 y^{2}-10 x y=-121$ and factoring we get:\n\n$$\n(2 x-y) \\cdot(5 y-x)=121 .\n$$\n\nBoth factors must be of the same sign. If they were both negative, we would have $2 x0$, the function $f(t)$ is\nstrictly convex on $(0, \\infty)$. Consequently,\n\n$$\n\\begin{aligned}\n\\frac{1}{\\cos \\gamma} & =\\sqrt{1+\\tan ^{2} \\gamma}=f(\\tan \\gamma)=f\\left(\\frac{\\tan \\alpha+\\tan \\beta}{2}\\right)< \\\\\n& <\\frac{f(\\tan \\alpha)+f(\\tan \\beta)}{2}=\\frac{1}{2}\\left(\\frac{1}{\\cos \\alpha}+\\frac{1}{\\cos \\beta}\\right)=\\frac{1}{\\cos \\delta},\n\\end{aligned}\n$$\n\nand hence $\\gamma<\\delta$.\n\nRemark. The use of calculus can be avoided. We only need the midpointconvexity of $f$, i.e., the inequality\n\n$$\n\\sqrt{1+\\frac{1}{4}(u+v)^{2}}<\\frac{1}{2} \\sqrt{1+u^{2}}+\\frac{1}{2} \\sqrt{1+v^{2}}\n$$\n\nfor $u, v>0$ and $u \\neq v$, which is equivalent (via squaring) to\n\n$$\n1+u v<\\sqrt{\\left(1+u^{2}\\right)\\left(1+v^{2}\\right)} .\n$$\n\nThe latter inequality reduces (again by squaring) to $2 u v|P Q|=2 \\cdot|P C|=\\frac{2}{\\cos \\gamma},\n$$\n\nand hence $\\delta>\\gamma$.\n\nAnother solution. Set $x=\\frac{\\alpha+\\beta}{2}$ and $y=\\frac{\\alpha-\\beta}{2}$, then $\\alpha=x+y, \\beta=x-y$ and\n\n$$\n\\begin{aligned}\n\\cos \\alpha \\cos \\beta & =\\frac{1}{2}(\\cos 2 x+\\cos 2 y)= \\\\\n& =\\frac{1}{2}\\left(1-2 \\sin ^{2} x\\right)+\\frac{1}{2}\\left(2 \\cos ^{2} y-1\\right)=\\cos ^{2} y-\\sin ^{2} x .\n\\end{aligned}\n$$\n\nBy the conditions of the problem,\n\n$$\n\\tan \\gamma=\\frac{1}{2}\\left(\\frac{\\sin \\alpha}{\\cos \\alpha}+\\frac{\\sin \\beta}{\\cos \\beta}\\right)=\\frac{1}{2} \\cdot \\frac{\\sin (\\alpha+\\beta)}{\\cos \\alpha \\cos \\beta}=\\frac{\\sin x \\cos x}{\\cos \\alpha \\cos \\beta}\n$$\n\nand\n\n$$\n\\frac{1}{\\cos \\delta}=\\frac{1}{2}\\left(\\frac{1}{\\cos \\alpha}+\\frac{1}{\\cos \\beta}\\right)=\\frac{1}{2} \\cdot \\frac{\\cos \\alpha+\\cos \\beta}{\\cos \\alpha \\cos \\beta}=\\frac{\\cos x \\cos y}{\\cos \\alpha \\cos \\beta} .\n$$\n\nUsing (3) we hence obtain\n\n$$\n\\begin{aligned}\n\\tan ^{2} \\delta-\\tan ^{2} \\gamma & =\\frac{1}{\\cos ^{2} \\delta}-1-\\tan ^{2} \\gamma=\\frac{\\cos ^{2} x \\cos ^{2} y-\\sin ^{2} x \\cos ^{2} x}{\\cos ^{2} \\alpha \\cos ^{2} \\beta}-1= \\\\\n& =\\frac{\\cos ^{2} x\\left(\\cos ^{2} y-\\sin ^{2} x\\right)}{\\left(\\cos ^{2} y-\\sin ^{2} x\\right)^{2}}-1=\\frac{\\cos ^{2} x}{\\cos ^{2} y-\\sin ^{2} x}-1= \\\\\n& =\\frac{\\cos ^{2} x-\\cos ^{2} y+\\sin ^{2} x}{\\cos ^{2} y-\\sin ^{2} x}=\\frac{\\sin ^{2} y}{\\cos \\alpha \\cos \\beta}>0,\n\\end{aligned}\n$$\n\nshowing that $\\delta>\\gamma$.", "metadata": {"resource_path": "BalticWay/segmented/en-bw98sol.jsonl", "problem_match": "\n9.", "solution_match": "\n9."}} {"year": "1998", "tier": "T3", "problem_label": "10", "problem_type": null, "exam": "BalticWay", "problem": "Let $n \\geqslant 4$ be an even integer. A regular $n$-gon and a regular $(n-1)$-gon are inscribed into the unit circle. For each vertex of the $n$-gon consider the distance from this vertex to the nearest vertex of the $(n-1)$-gon, measured along the circumference. Let $S$ be the sum of these $n$ distances. Prove that $S$ depends only on $n$, and not on the relative position of the two polygons.", "solution": "For simplicity, take the length of the circle to be $2 n(n-1)$ rather than $2 \\pi$. The vertices of the $(n-1)$-gon $A_{0} A_{1} \\ldots A_{n-2}$ divide it into $n-1$ arcs of length $2 n$. By the pigeonhole principle, some two of the vertices of the $n$-gon $B_{0} B_{1} \\ldots B_{n-1}$ lie in the same arc. Assume w.l.o.g. that $B_{0}$ and $B_{1}$ lie in the arc $A_{0} A_{1}$, with $B_{0}$ closer to $A_{0}$ and $B_{1}$ closer to $A_{1}$, and that $\\left|A_{0} B_{0}\\right| \\leqslant\\left|B_{1} A_{1}\\right|$.\n\nConsider the circle as the segment $[0,2 n(n-1)]$ of the real line, with both of its endpoints identified with the vertex $A_{0}$ and the numbers $2 n, 4 n, 6 n, \\ldots$ identified accordingly with the vertices $A_{1}, A_{2}, A_{3}, \\ldots$\n\nFor $k=0,1, \\ldots, n-1$, let $x_{k}$ be the \"coordinate\" of the vertex $B_{k}$ of the $n$-gon. Each arc $B_{k} B_{k+1}$ has length $2(n-1)$. By the choice of labelling, we have\n\n$$\n0 \\leqslant x_{0}10$, as no tile is allowed to extend beyond the edge of the board. But then $b_{13}=a_{10}$ must be both even and odd, a contradiction.\n\nAlternative solution. Colour the squares of the board black and white in the following pattern. In the first (top) row, let the two leftmost squares be black, the next two be white, the next two black, the next two white, and so on (at the right end there remains a single black square). In the second row, let the colouring be reciprocal to that of the first row (two white squares, two black squares, and so on). If the rows are labelled by 1 through 13 , let all the odd-indexed rows be coloured as the first row, and all the even-indexed ones as the second row (see Figure 7).\n\nNote that there are more black squares than white squares in the board. Each $4 \\times 1$ tile, no matter how placed, covers two black squares and two white squares. Thus if a tiling leaves a single square uncovered, this square must be black. But the central square of the board is white. Hence such a tiling is impossible.\n\nAnother solution. Colour the squares in four colours as follows: colour all squares in the 1-st column green, all squares in the 2-nd column black, all squares in the 3 -rd column white, all squares in the 4 -th column red, all squares in the 5 -th column green, all squares in the 6 -th column black etc., leaving only the central square uncoloured (see Figure 8). Altogether we have $3 \\cdot 13=39$ black squares and $3 \\cdot 13-1=38$ white squares. Since\neach $4 \\times 1$ tile covers either one square of each colour or all four squares of the same colour, then the difference of the numbers of black and white squares must be divisible by 4 . Since $39-38=1$ is not divisible by 4 , the required tiling does not exist.\n\n![](https://cdn.mathpix.com/cropped/2024_04_17_265f402a46c0191f8856g-16.jpg?height=510&width=520&top_left_y=423&top_left_x=174)\n\nFigure 7\nG BWR G B WR G BWR G\n\n![](https://cdn.mathpix.com/cropped/2024_04_17_265f402a46c0191f8856g-16.jpg?height=500&width=504&top_left_y=432&top_left_x=785)\n\nFigure 8", "metadata": {"resource_path": "BalticWay/segmented/en-bw98sol.jsonl", "problem_match": "\n16.", "solution_match": "\n16."}} {"year": "1998", "tier": "T3", "problem_label": "17", "problem_type": null, "exam": "BalticWay", "problem": "Let $n$ and $k$ be positive integers. There are $n k$ objects (of the same size) and $k$ boxes, each of which can hold $n$ objects. Each object is coloured in one of $k$ different colours. Show that the objects can be packed in the boxes so that each box holds objects of at most two colours.", "solution": "If $k=1$, it is obvious how to do the packing. Now assume $k>1$. There are not more than $n$ objects of a certain colour - say, pink - and also not fewer than $n$ objects of some other colour - say, grey. Pack all pink objects into one box; if there is space left, fill the box up with grey objects. Then remove that box together with its contents; the problem gets reduced to an analogous one with $k-1$ boxes and $k-1$ colours. Assuming inductively that the task can be done in that case, we see that it can also be done for $k$ boxes and colours. The general result follows by induction.", "metadata": {"resource_path": "BalticWay/segmented/en-bw98sol.jsonl", "problem_match": "\n17.", "solution_match": "\n17."}} {"year": "1998", "tier": "T3", "problem_label": "18", "problem_type": null, "exam": "BalticWay", "problem": "Determine all positive integers $n$ for which there exists a set $S$ with the following properties:\n\n(i) $S$ consists of $n$ positive integers, all smaller than $2^{n-1}$;\n\n(ii) for any two distinct subsets $A$ and $B$ of $S$, the sum of the elements of $A$ is different from the sum of the elements of $B$.", "solution": "Answer: all integers $n \\geqslant 4$.\n\nDirect search shows that there is no such set $S$ for $n=1,2,3$. For $n=4$ we can take $S=\\{3,5,6,7\\}$. If, for a certain $n \\geqslant 4$ we have a set $S=\\left\\{a_{1}, a_{2}, \\ldots, a_{n}\\right\\}$ as needed, then the set $S^{*}=\\left\\{1,2 a_{1}, 2 a_{2}, \\ldots, 2 a_{n}\\right\\}$ satisfies the requirements for $n+1$. Hence a set with the required properties exists if and only if $n \\geqslant 4$.", "metadata": {"resource_path": "BalticWay/segmented/en-bw98sol.jsonl", "problem_match": "\n18.", "solution_match": "\n18."}} {"year": "1998", "tier": "T3", "problem_label": "19", "problem_type": null, "exam": "BalticWay", "problem": "Consider a ping-pong match between two teams, each consisting of 1000 players. Each player played against each player of the other team exactly once (there are no draws in ping-pong). Prove that there exist ten players, all from the same team, such that every member of the other team has lost his game against at least one of those ten players.", "solution": "We start with the following observation: In a match between two teams (not necessarily of equal sizes), there exists in one of the teams a player who won his games with at least half of the members of the other team.\n\nIndeed: suppose there is no such player. If the teams consist of $m$ and $n$ members then the players of the first team jointly won less than $m \\cdot \\frac{n}{2}$ games, and the players of the second team jointly won less than $m \\cdot \\frac{n}{2}$ games - this is a contradiction since the total number of games played is $m n$, and in each game there must have been a winner.\n\nReturning to the original problem (with two equal teams of size 1000), choose a player who won his games with at least half of the members of the other team - such a player exists, according to the observation above, and we shall call his team \"first\" and the other team \"second\" in the sequel. Mark this player with a white hat and remove from further consideration all those players of the second team who lost their games to him. Applying the same observation to the first team (complete) and the second team truncated as explained above, we again find a player (in the first or in the second team) who won with at least half of the other team members. Mark him with a white hat, too, and remove the players who lost to him from further consideration.\n\nWe repeat this procedure until there are no players left in one of the teams; say, in team $Y$. This means that the white-hatted players of team $X$ constitute a group with the required property (every member of team $Y$ has lost his game to at least one player from that group). Each time when a player of team $X$ was receiving a white hat, the size of team $Y$ was reduced at least by half; and since initially the size was a number less than $2^{10}$, this could not happen more than ten times.\n\nHence the white-hatted group from team $X$ consists of not more than ten players. If there are fewer than ten, round the group up to ten with any players.", "metadata": {"resource_path": "BalticWay/segmented/en-bw98sol.jsonl", "problem_match": "\n19.", "solution_match": "\n19."}} {"year": "1998", "tier": "T3", "problem_label": "20", "problem_type": null, "exam": "BalticWay", "problem": "We say that an integer $m$ covers the number 1998 if $1,9,9,8$ appear in this order as digits of $m$. (For instance, 1998 is covered by 215993698 but not by 213326798 .) Let $k(n)$ be the number of positive integers that cover 1998 and have exactly $n$ digits $(n \\geqslant 5)$, all different from 0 . What is the remainder of $k(n)$ in division by 8 ?\n\n## Solutions", "solution": "Answer: 1.\n\nLet $1 \\leqslant g