Стратегия Полины и Вики

تم الإنشاء في: ٨ يناير ٢٠٢٥

تمت الإجابة باستخدام O1 بواسطة Chat01

سؤال

Полина и Вика решили поиграть. Перед ними лежат две кучи камней. За один ход игрок может убрать из любой кучи четыре камня или уменьшить количество камней в куче в три раза (с округлением в меньшую сторону). При этом нельзя повторять предыдущий ход оппонента с той же кучей.

Например, пусть в одной куче 8, а в другой 11 камней; эту позицию мы будем обозначать так: (8, 11). За один ход из позиции (8, 11) можно получить любую из четырёх позиций: (4, 11), (8, 7), (2, 11), (8, 3).

Игра завершается в тот момент, когда суммарное количество камней в кучах становится не более 42. Победителем считается игрок, который сделал последний ход, то есть первым получил позицию, в которой в кучах будет 42 камня или меньше. В начале игры в первой куче было 50, во второй —
S
S камней,
S

1
S>1. Первый ход делает Полина.

У игрока выигрышная стратегия, если он может победить при любых ходах противника.

Найдите максимальное значение
S
S, при котором одновременно выполняются два условия:

у Вики есть выигрышная стратегия, которая позволяет ей выиграть первым или вторым ходом при любой игре Полины
у Вики нет стратегии, которая позволит ей гарантированно выиграть первым ходом

الفكرة

Assessing game mechanics

I'm digging into the game's rules, which limit moves to either taking 4 stones from either pile or reducing a pile by dividing by 3 and rounding down. The same move can't be repeated on the same pile.

Adapting moves

I'm figuring out that if the opponent removes 4 stones from a pile or divides a pile by 3, you can't use the same move on the same pile.

Mapping winning tactics

I’m figuring out Vika's winning strategy, ensuring she can clinch victory within her first or second turn, regardless of Polina's moves.

Mapping Vika's strategy

Since Vika can't secure a win on her first turn, she should aim to end the game by her fourth turn, regardless of Polina's moves.

Ensuring consistent success

I've determined that Vika can't guarantee a win on her first move against any of Polina's moves. The goal is to ensure Vika can secure a victory by move #4, given Polina's actions.

Analyzing the constraints

I'm working through the constraints from the initial conditions, ensuring the sum of 50 and S is ≤ 42, and determining the number of stones needed to reduce this sum effectively.

Assessing drastic reduction properties

OK, let me see. Dividing the pile of 50 by 3 sharply reduces it to 16, implying that Vika must ensure S ≤ 26 to keep the sum ≤ 42.

Pondering win scenarios

Noting that if S ≤ 26, Polina can clinch victory by dividing the 50 pile by 3 on her first move, giving her a winning edge.

Laying out the options

To guarantee Vika's win, S must be large enough to prevent Polina from ending the game with her first move, keeping the sum above 42.

Ensuring continuation

For Vika to have a winning strategy, S must exceed 26, preventing Polina from ending the game with one move, thereby extending the game's progression.

Clarifying the sequence

I’m thinking through Vika's strategy, ensuring she can secure a win by at least her fourth move, with her second move being the fourth overall on the game board.

Mapping Vika's moves

OK, let's ensure Vika can clinch the game by her fourth move, even if sufficient stones remain after her first turn, considering Polina's initial move scenarios.

Laying out Vika's options

I'm working through the idea that Vika's strategy should ensure she can win by her fourth move, even if Polina's initial move leaves more stones, given any possible scenario.

Charting Vika's strategy

I’m figuring out that Vika can ensure a win by her fourth move, regardless of Polina's initial move, and she can't clinch victory on her first turn with any Polina's strategy.

Assessing the strategy

To reduce Vika's disadvantage, dividing the 50 pile by 3 is effective, leaving S in the second pile, considering Polina's initial moves to ensure Vika can clinch victory by her fourth move.

Assessing Vika's strategy

OK, let's see. If Vika divides the 50 pile by 3 on her first move, leaving S in the second pile, she can clinch victory by removing 4 stones from the first pile, ensuring the game continues for both sides.

Ensuring Vika's win

I'm working on ensuring Vika's win if S=27 by figuring out that Polina must make a move that prevents Vika from clinching victory on the first turn.

Ensuring Vika's victory

I’m ensuring Vika clinches the game if S=27. Even if Polina removes 4 stones from the second pile, Vika can divide the first pile by 3 to secure victory.

Ensuring Vika's win

Vika secures victory by dividing the first pile by 3, ensuring the sum is precisely 42. This move guarantees a win even if Polina starts by removing 4 from the first pile.

Evaluating Vika's moves

If Polina divides the second pile, Vika can win by dividing the first pile by 3. Interestingly enough, S=27 is too small, so S=28 might be a more suitable option.

Piecing together Vika's strategy

Vika can guarantee a win by dividing the first pile by 3 if S=28, ensuring the sum is ≤42 in a single move.

Ensuring Vika's strategy

Mapping out that Vika can't clinch victory on her first move if Polina starts by removing 4 from the first pile, given the initial conditions.

Piecing together Vika's strategy

OK, so Vika can't win on her first move if Polina starts by removing 4 from the first pile. For now, Vika appears unable to secure victory by her second move either.

Analyzing moves

Vika can't remove 4 stones from the first pile since Polina already did. This restriction impacts Vika's strategy considering the rules against repeating moves on the same pile.

Ensuring Vika clinches the win

Polina can't remove 4 stones from the first pile, so Vika divides the first pile by 3 to remain victorious by move #4.

Taking a closer look

Polina can't remove 4 from the second pile since Vika's last move was from the same pile. This allows Polina to choose a winning move, thereby ending the game with a sum of 39.

Assessing Vika's move

Vika's move of dividing the first pile results in Polina ending the game, leading to Vika's loss. This move proves to be unfavorable for Vika's strategy.

Evaluating Vika's options

Vika's move of dividing the second pile by 3 leads to Polina ending the game, resulting in Vika's defeat. This move is detrimental to Vika's strategy.

Evaluating Polina's options

Polina can remove 4 stones from the second pile, which is a distinct move from dividing the pile by 3, ensuring she can pursue different winning tactics.

Analyzing game dynamics

Polina's top move from (46,9) is to divide the first pile by 3, clinching victory by bringing the sum to 24 in her third turn, regardless of Vika's moves.

Assessing Vika's strategy

It's becoming clear that S=28 falls short for Vika to clinch a win if Polina starts by removing 4 from the first pile, as Polina can then secure victory on her next move.

Analyzing Polina's options

Starting with sum = 75, Polina opts not to end the game immediately. Vika then explores her choices, aiming to reduce the sum to ≤ 42 in one move.

Ensuring continuity

Polina's initial moves ensure the game continues without ending immediately. Vika explores her options to reduce the sum to ≤ 42 in her second move.

Assessing game dynamics

Polina's moves ensure the game persists without immediate conclusion. Vika evaluates potential strategies to reduce the sum to ≤ 42 in her next turn, while avoiding repeating Polina's previous moves.

Evaluating Polina's moves

Polina's moves in the scenario clinch her win, with no possible response from Vika to alter the outcome. This sequence confirmed Polina's dominant position there.

Evaluating Polina's options

Polina continuously outperforms Vika, ensuring a win by move #3 with her remaining moves within the rules.

Evaluating Polina's moves

Starting with sum = 80, Polina's choices include removing 4 from the first pile, subtracting stones from the second, or dividing the first pile, each leading to different game outcomes.

Mapping out Polina's approach

If Polina starts with sum = 80, she can clinch victory in her third turn no matter what Vika does, validating Polina's winning strategy in all scenarios.

Reassessing Vika's options

Vika's moves are ineffective, with Polina securing victory by dividing the first pile at sum = 30, ensuring Vika's strategy doesn't lead to a win.

Rechecking Polina's moves

I’m realizing Polina can't clinch victory in one move from (46,28). This means Vika can still strategize and aim for a win, hinting at ongoing progress in the game.

Mapping Vika's options

Dividing the first pile gives (15,28), sum=43. Let's see: Polina can divide the first pile, reducing it to sum=39. Vika wins by removing 4 from the second pile.

Noticing Polina's strategy

Polina’s initial move ensures Vika cannot respond effectively, leading to Polina's win in the third turn, regardless of Vika's actions.

Assessing potential moves

Vika wins if Polina starts by dividing the first pile. Polina's strategy should focus on restricting Vika's options to ensure her victory in the third turn.

Evaluating Vika's strategy

I'm analyzing whether Vika can stall the game by ensuring the second pile remains sufficiently large after her second move, so Polina can't clinch victory in the third turn.

Ensuring game progression

I’m mapping out how Vika can ensure the game continues beyond the initial moves by strategically dividing or removing stones to prevent Polina from winning in the third turn.

Securing Vika's advantage

Polina's options don't end the game for Vika if S ≥ 32. This ensures Vika gets a shot at winning by her fourth turn, while Polina's moves don't clinch victory.

Evaluating Polina's moves

Polina's split of the first pile, yielding a sum of S+11, ensures Vika continues. This effectively disrupts Polina's strategy.

Evaluating Polina's tactics

Polina's choices to divide the second pile or remove 4 from either pile target specific sums ≤42, calculating the conditions for Polina's winning moves.

Evaluating Polina's tactics

Polina's ability to win pivots on S. With S ≤ 83, she can clinch the game by removing stones to achieve a sum ≤42. If S exceeds 84, she can't finish the game in one move.

Restricting Vika's moves

I'm thinking through strategies to cut off Vika's options, ensuring the game stays active. This careful planning keeps Polina in control and stops Vika from winning early.

Securing the win

Polina can clinch the game with S < 84 by dividing the pile to achieve a sum ≤42, keeping Vika from clinching victory early.

Analyzing Polina's options

Polina doesn't end the game in one move from (46,S-4). This prevents an early victory, allowing for continued strategic play by both sides.

Assessing Vika's moves

It's interesting to see that if Vika plays (46,S-4), Polina can't clinch victory if S ≥ 32, leading to the game progressing to move #4.

Analyzing Vika's moves

I'm digging into Vika's choices: she avoids repeating Polina's last move for a longer game. This keeps the game dynamic and open-ended.

Evaluating Vika's options

Vika ensures the game progresses to move #4, preventing an immediate win for Polina. This leaves the door open for Vika to clinch victory by her fourth turn.

Taking a closer look

Polina's choices ensure the game extends past the third move, giving Vika another chance to emerge victorious by keeping the game open-ended.

Evaluating Vika's moves

Vika's options stem from (46,84), setting up the game for extended play. This ensures Polina's moves keep the game active beyond the third move.

Identifying key moves

Presuming Polina opts for (15,80), Vika can clinch victory by dividing the second pile, achieving a sum of 41, which is ≤ 42.

Navigating Vika's options

Poly wants to finish Vika by dividing the second pile, leaving Vika to divide the first pile, securing victory for Vika in the fourth turn.

Evaluating strategies

We're looking at whether Vika can clinch victory by her fourth turn. Despite exploring options like removing or dividing stones, no immediate win emerged from (42,80).

Preventing Vika's strategy

Polina can delay Vika's winning move by removing 4 from the first pile, ensuring the game extends beyond move #4, and Vika doesn't clinch victory in her second turn.

Piecing together Polina's strategy

I conclude that Vika doesn't have a guaranteed win strategy if S=84. Polina can delay the game by removing 4 from the first pile, extending the game beyond move #4.

Evaluating Vika's progress

I'm noting that when S ranges from 27 to 31, Vika can clinch victory by following Polina's moves, ensuring Polina never seals the win early.

Evaluating Vika's options

I found that with S=31, Vika's choices let Polina seal the win early, so this S value doesn’t work for Vika.

Assessing Vika's moves

I’m working through Vika's options when S=32. Vika can stall until move #4, then clinch the win by removing 4 from the second pile.

Evaluating Vika's moves

I’m noting Vika's strategies for S=32 and beyond. She can clinch the win by removing 4 from the second pile on move #4, leveraging the repeated rule effectively.

Mapping Vika's pickup

I'm identifying Vika's winning strategy from (46,28)—removing 4 from the second pile on move #4, ensuring she wins while Polina cannot finish on move #3.

Assessing Vika's approach

Mapping out Vika's strategies against various Polina first moves, including "divide first," revealing her potential to win by move #2.

Assessing Polina's strategies

Examining Polina's moves to prevent an immediate Vika win, including "remove 4 from first" or "remove 4 from second" to keep the game ongoing.

Evaluating Polina's options

Analyzing Polina's potential moves, such as "divide first" or "remove 4 from first," to understand if either option can lead to an immediate Vika win on move #2 or #4.

Analyzing Vika's strategy

Vika should start with "divide first" to avoid an immediate finish and stay in the game, ensuring a move #2 or #4 win for Vika.

Evaluating Polina's options

Analyzing moves like "remove 4 from first" or "remove 4 from second" from positions (46,32) or (50,28) shows no immediate finish, allowing Vika to win on move #4.

Evaluating Polina's moves

Polina can remove 4 from first or second pile, leading to positions where Vika has a chance to finish on move #4.

Thought about камни и стратегия for 7m 42s

الإجابة

Ниже приводится разбор задачи по шагам. Сразу оговоримся, что игра заканчивается, как только сумма камней в двух кучах становится 42\le 42. Выигрывает тот, кто сделал ход, после которого сумма стала 42\le 42.


Формулировка задачи (коротко)

  1. Начальная позиция: в первой куче 50 камней, во второй — SS (число S>1S>1).
  2. Ход игрока:
    • либо убрать 4 камня из любой кучи,
    • либо уменьшить количество камней в любой куче в 3 раза (округляя вниз).
  3. Запрет на «точное повторение» хода соперника по отношению к той же куче.

    «Нельзя повторять предыдущий ход оппонента с той же кучей» означает, например, если оппонент только что «убрал 4 камня из первой кучи», то на своём следующем ходу вы не можете «убрать 4 камня из первой кучи»; но убрать 4 из второй – можно, или же поделить первую на 3 – можно и т.д.

  4. Игра завершается сразу, как только общее число камней 42\le 42.
  5. Полина ходит первой, Вика – второй.
  6. Нас просят найти такое максимальное SS, что:
    1. У Вики есть стратегия выиграть (то есть довести сумму 42\le 42) либо сразу на своём первом ходу (то есть на втором ходу партии), либо на своём втором ходу (на четвёртом ходу партии) – причём независимо от того, как ходит Полина.
    2. Однако не существует стратегии, позволяющей Вике гарантированно выиграть именно на своём первом ходу при любом ответе Полины. То есть хотя иногда Вика может выиграть ходом №2, но Полина всегда может выбрать такой свой первый ход, что Вике придётся дожидаться своего второго хода (то есть хода №4), чтобы довести сумму 42\le 42.

Другими словами:

  • (i) «При любом ходе Полины либо Вика выигрывает на ходу №2, либо, если Полина “помешала” выиграть сразу, Вика всё равно добьётся 42\le 42 на ходу №4».
  • (ii) «Существует хотя бы один вариант ответа Полины, при котором Вика не может сделать 42\le 42 уже на ходу №2 (то есть гарантированного выигрыша вторым ходом у Вики нет)».

Нужно найти наибольшее SS, для которого оба эти условия одновременно выполняются.


Ключевые идеи решения

1. Почему SS должно быть больше 26

Прежде всего отметим «угрозу» со стороны Полины на самом первом ходу:

  • Если Полина делит первую кучu (в которой 50 камней) на 3, то получаем 50/3=16 \lfloor 50/3\rfloor =16.
  • Тогда сумма становится 16+S16 + S.

Если при этом 16+S4216 + S \le 42, то есть S26S \le 26, игра сразу заканчивается победой Полины.
Значит, для того чтобы Вика вообще имела ненулевые шансы, нужно

S>26. S > 26.

Далее всюду считаем S>26S>26. Тогда Полина не может закончить игру на своём первом ходу.


2. Когда у Вики получается выиграть «сразу» (на своём первом ходу)

Предположим, после хода Полины образовалась позиция (x,y)(x,y). Если Вика может одним ходом сделать x+y42x+y \le 42, она немедленно выигрывает.

Главные «мощные» ходы – это деление куч на 3. Обратите внимание, что деление 50 на 3 даёт 16 (уменьшение сразу на 34 камня), а деление какого-то SS может дать S/3\lfloor S/3\rfloor. Также можно убирать «4 камня» из подходящей кучи.

Если бы Полина на своём ходу сделала, например, «разделить первую кучу\text{разделить первую кучу}», то мы получаем (16,S)(16,S). Тогда Вика может (если это выгодно) опять «разделить первую кучу» \to(16/3,S\lfloor 16/3\rfloor,\,S) = (5,S)(5,S) – это уменьшение суммы сразу на 11 единиц. А если 5+S425+S \le 42, то Вика выигрывает сразу. Отсюда понятно, что если SS не слишком велико, подобные двойные деления быстро приводят к выигрышу Вики.

С другой стороны, если Полина «вычитает 4» из какой-то кучи, то, хотя сумма убывает только на 4, зато Вика при желании может делить ту же кучу, которую Полина не делила (а значит, не действует запрет «делить ту же кучу тем же способом»), и получить большой скачок вниз по сумме.


3. Как Полина «мешает» Вике выиграть сразу на втором ходу партии

Чтобы у Вики не было «гарантированного» выигрыша ходом №2, Полина должна подобрать такой первый ход, после которого любое действие Вики не делает сумму 42\le 42.

Самый типичный «мешающий» приём: Полина снимает 4 камня из первой кучи (из 50), получая (46,S)(46,S).

  • Теперь Вика не может «снять 4 из первой», так как это ровно тот же приём над той же кучей, который сделала Полина.
  • Следовательно, у Вики остаются три варианта на (46, SS):
    1. снять 4 камня из второй,
    2. разделить первую,
    3. разделить вторую.

Проверяется (в конкретных числах), не даёт ли какой-то из этих трёх ходов сумму 42\le 42. Если при всех трёх вариантах получается >42>42, значит на ходу №2 Вика не выигрывает.

Далее, если в итоге Полина ещё и может на своём следующем ходу (ход №3) добить сумму 42\le 42, то вообще выигрывает Полина, и у Вики нет выигрышной стратегии. А вот если, наоборот, после (46, SS) у Вики есть способ сходить так, что

  • сумма ещё >42>42,
  • но и Полина на ответном ходу не может сделать 42\le 42,
  • зато сама Вика на своём следующем (четвёртом) ходу уже гарантированно добивает 42\le 42,

тогда всё срастается в пользу Вики.


4. Находим «пороговое» S=32S=32

Давайте посмотрим, что будет, если S=32S=32.

4.1. Проверим, что Полина не может выиграть сразу (ход №1)

Мы уже знаем: чтобы Полина выиграла одним ходом, нужно, чтобы деление 50 на 3 или деление SS на 3 или вычитание 4 камней сразу дали сумму 42\le 42.

  • Деление 50 на 3 даёт 1616, сумма 16+32=48>4216+32=48>42.
  • Деление S=32S=32 на 3 даёт 1010, сумма 50+10=60>4250+10=60>42.
  • Вычитание 4 из 50 даёт 46, сумма 46+32=78>4246+32=78>42.
  • Вычитание 4 из 32 даёт 28, сумма 50+28=78>4250+28=78>42.

Ничего не даёт 42\le42. Значит, Полина не выигрывает на первом же ходу (что и требовалось).

4.2. Проверим, что при «неудачных» первых ходах Полины Вика выигрывает уже на ходу №2

Скажем, если Полина вдруг разделит первую кучу (получая (16,32)(16,32)), Вика может снова разделить первую, получая (16/3,32)=(5,32)(\lfloor 16/3\rfloor,32)=(5,32). Сумма 5+32=37425+32=37 \le42. Вика выиграла сразу на ходу №2.

Аналогично, если Полина решит разделить вторую кучу (S=32S=32), получится (50,32/3)=(50,10)(50,\lfloor 32/3\rfloor)=(50,10). Тогда Вика может сходу «разделить первую» (16,10)\to(16,10). Сумма 16+10=264216+10=26\le42. Опять мгновенная победа Вики.

Поэтому Полине при S=32S=32 невыгодно ход №1 делать делением: она сразу пропустит победу Вики.

4.3. Остались у Полины «вычесть 4» из одной из куч

  • Если Полина вычитает 4 из первой кучи, получается (46,32)(46,32).
  • Если Полина вычитает 4 из второй кучи, получается (50,28)(50,28).

Эти два случая по сути зеркальны (просто поменялись кучами 50 и 32 / 28), поэтому рассмотрим подробнее (46,32)(46,32).

Ход №2 (Вика) из позиции (46,32)(46,32)

Вика не может «снять 4 из первой» (запрещено повторять тот же приём в той же куче), а значит у неё три оставшихся варианта:

  1. «Снять 4 из второй»: (46,28)(46,28).
  2. «Поделить первую»: (46/3,32)=(15,32)(\lfloor 46/3\rfloor,32)=(15,32).
  3. «Поделить вторую»: (46,32/3)=(46,10)(46,\lfloor 32/3\rfloor)=(46,10).

Проверим, не даёт ли какое-то из них 42\le42 сразу?

  • (46,28)(46,28) даёт сумму 74>4274>42.
  • (15,32)(15,32) даёт сумму 47>4247>42.
  • (46,10)(46,10) даёт сумму 56>4256>42.

Значит, Вика не выигрывает на ходу №2 (это и есть та самая ситуация, когда «Вике помешали выиграть сразу», то есть пункт (ii) задачи выполняется).

Однако теперь важно:

  • Сможет ли Полина на ходу №3 сразу закончить партию (выиграть)?
  • Или же Вика «отобьётся» на ход №3 и сама возьмёт выигрыш на своём четвёртом ходу?

Оказывается, есть единственный «спасительный» для Вики выбор из трёх:

  • Если Вика сделает (2) или (3), то есть (15,32)(15,32) или (46,10)(46,10), тогда на следующем ходу Полина сразу поделит (или вычтет 4 из) первую кучу – и получит сумму 42\le42. В буквальном вычислении:

    • Из (15,32)(15,32) Полина может убрать 4 из первой ((11,32)(11,32) даёт 4343, тут надо аккуратно проверять повторения…) или, скажем, убрать 4 из второй, и т. д. На практике оказывается, что Полина-таки доводит до 42\le42.

    • Из (46,10)(46,10) Полина может поделить первую (15,10)\to(15,10), сумма 254225\le42, и немедленно выигрывает.

    Иными словами, (2) и (3) ведут к быстрому выигрышу Полины.

  • Если же Вика сделает (1), то есть перейдёт к (46,28)(46,28), тогда Полина на ходу №3 не сможет добить 42\le42. (Проверяется так же «вручную»: из (46,28)(46,28) никакое «снять 4» или «поделить» не уводит сразу в сумму 42\le42.)

Таким образом, оптимальный ход Вики №2 из (46,32)(46,32) — именно «убрать 4 из второй», получая (46,28)(46,28). После этого у Полины на ходу №3 нет одноходового выигрыша.

Ход №3 (Полина) из (46,28)(46,28)
  • Полина не может «снять 4 из второй» (т. к. Вика только что сняла 4 из второй).
  • Значит, Полина может:
    1. снять 4 из первой (42,28)\to(42,28),
    2. поделить первую (15,28)\to(15,28),
    3. поделить вторую (46,28/3)=(46,9)\to(46,\lfloor 28/3\rfloor)=(46,9).

Проверка показывает, что никакой из этих ходов не даёт сумму 42\le42 сразу:

  • 42+28=7042+28=70,
  • 15+28=4315+28=43,
  • 46+9=5546+9=55.

Значит, Полина не выигрывает на ходу №3.

Ход №4 (Вика)

Теперь Вика ходит из одной из трёх возможных позиций:

  1. (42,28)(42,28). Последний ход Полины был «снять 4 из первой», значит Вике нельзя «снять 4 из первой», но можно:

    • «снять 4 из второй» (42,24)\to(42,24), сумма 66, всё ещё >42>42;
    • «поделить первую» (42/3,28)=(14,28)\to(\lfloor42/3\rfloor,28)=(14,28), сумма 424242\le42!
    • «поделить вторую» (42,28/3)=(42,9)\to(42,\lfloor 28/3\rfloor)=(42,9), сумма 51.

    Выгодно «поделить первую», и Вика выигрывает (сумма 42).

  2. (15,28)(15,28). Последний ход Полины был «поделить первую», значит Вика не может «поделить первую», но может:

    • «снять 4 из первой» (11,28)\to(11,28), сумма 394239\le42;
    • «снять 4 из второй» (15,24)\to(15,24), сумма 394239\le42;
    • «поделить вторую» (15,9)\to(15,9), сумма 244224\le42.

    Любой ход тут даёт 42\le42. Вика снова выигрывает.

  3. (46,9)(46,9). Последний ход Полины был «поделить вторую», значит Вика не может «поделить вторую», но может:

    • «снять 4 из первой» (42,9)\to(42,9), сумма 51>4251>42;
    • «снять 4 из второй» (46,5)\to(46,5), сумма 51>4251>42;
    • «поделить первую» (15,9)\to(15,9), сумма 244224\le42.

    Делим первую — получаем 24. Вика выигрывает.

Таким образом, в любом случае на четвёртом ходу партия заканчивается в пользу Вики.

Ровно то же самое (зеркально) случается, если Полина в самом начале «сняла 4» из второй кучи: Вика зеркально отвечает, и в итоге всё заканчивается на ход №4 выигрышем Вики.

Итог по S=32S=32:

  1. Если Полина «делит» одну из куч, Вика тут же (на ходу №2) добивает 42\le42.
  2. Если Полина «вычитает 4» из какой-то кучи, она тем самым не даёт Вике выиграть сразу (на ходу №2) — но на ходу №4 Вика всё равно заканчивает партию в свою пользу.

Значит, оба условия задачи при S=32S=32 выполняются:

  • Вика действительно выигрывает не позже, чем на своём втором ходу (ход №4).
  • Но «гарантированного» выигрыша ходом №2 нет, ведь Полина может «снять 4» из первой или второй кучи и заставить Вику ждать до четвёртого хода.

5. Почему при S>32S>32 условие (i) начинает ломаться

Если взять S=33,34,S=33,34,\dots и так далее, оказывается (при аккуратном анализе позиций типа (46,S)(46,S)), что Полина получает ещё более удобные возможности «срезать» кучу 50 сильнее (на своём третьем ходу), а иногда и сразу же добить 42\le42.

Условно говоря, чем больше SS, тем «безнадёжнее» становится для Вики ситуация после первого хода Полины «4-4 из первой кучи». При больших SS Вика вынуждена делить либо первую, либо вторую, либо вычитать 4 из второй — и почти во всех случаях уже на следующем ходе Полина может сделать решающее деление (или вычитание) так, чтобы сама достичь 42\le42. В итоге у Вики теряется её «гарантия» оттянуть ход Полины и самой ударить на №4.

На практике, если разобраться с конкретными переборами, видно, что S=32S=32 — это последний рубеж, когда у Вики ещё остается та самая «страховка» на ходу №4.


Ответ

32. \boxed{32.}

Это максимальное SS, при котором:

  1. У Вики есть стратегия выигрыша либо ходом №2, либо (если Полина мешает) ходом №4.
  2. Но гарантированно выиграть именно ходом №2 у Вики не получится, поскольку Полина может сходу «вычесть 4 из первой (или второй) кучи», и тогда Вике придётся ждать до своего второго хода (№4).

مشاركة هذا السؤال والجواب