2014 TCO Algorithm Round 3A - Division I, Level One

How to approach this problem?