Part of 2013 Argentina National Olympiad
Source: Argentine National Olympiad 2013, Level 3, Problem 4