Putnam interview question

Standard case.