Problem

Source: Swiss TST 2019 P8

Tags: number theory, combinatorics



Let $k,n,r$ be positive integers and $r<n$. Quirin owns $kn+r$ black and $kn+r$ white socks. He want to clean his cloths closet such there does not exist $2n$ consecutive socks $n$ of which black and the other $n$ white. Prove that he can clean his closet in the desired manner if and only if $r\geq k$ and $n>k+r$.