Prove that in a necklace consisting of $kX$ blue beads and $kY$ red beads, there exists a substring of length $X + Y$, with $X$ blue beads and $Y$ red beads.
I found this claim while solving a competitive programming problem, and the proof provided seemed wrong. To check the claim, I coded a random checker in Python, and it seems that the claim is correct.
In the problem, by substring, I mean a continuous subsegment of the necklace. Also, since it's a necklace, the first and last beads are considered adjacent.