Bending Spoons interview question

Medium-complexity math problems