Part of 2014 Argentine National Olympiad, Level 3
Source: Argentine National Olympiad 2014, Level 3, Problem 6