This problem was solved by Ali and Prateek , both from Riccarton High School in Christchurch, New Zealand, by Malcolm and Hamish, both from Madras College in St Andrews, Scotland, and by Daniella, Alice and Alice L from The Mount School in York.

Well done to you all.

Below are a couple of the solutions we received.

Daniella, Alice and Alice's solution.
By Daniella, Alice L and Alice U

Prateek's solution.
By Prateek