Problem

Source: 2022 IGMO Revenge #5 by International Gamma Mathematical Olympiad Revengers

Tags: counting, combinatorics, winning strategy



Let $a, b, n$ be positive integers in which $a, b \le n$. You are locked in a room, with $n$ distinguishable keys and $n$ distinguishable locks in it. You know that each lock can be unlocked by a unique key, but you don’t know which key unlocks which lock. You also know each key initially has a durablility of $a$ and each lock initially has a durability of $b$. The only way out of the room is to unlock at least one of the locks, but each time you try to unlock a lock using a key, the durablility of both that lock and key will decrease by $1$. A key or lock cannot be used for any further unlocking attempts if its durability is $0$. For each $n$, what pairs of $a, b$ guarentee a strategy which you can certainly leave the room? (by ? ? ?#3107)