SciOI 2023 Open Contest

It is optimal for MKMK students to use MM umbrellas, move to the SciCom Building, and then have one student return with MM umbrellas, repeating this process. Simulating this will yield the answer.

If M=K=1M=K=1 and N>1N > 1, it is impossible for all students to cross to the SciCom Building, so the output should be 1-1.