Bending Spoons interview question

Solve some logic problem in a limited time.