Cut the sticks solution