Problem

Source: Regional Olympiad - Federation of Bosnia and Herzegovina 2012

Tags: combinatorics, Harry Potter



Harry Potter can do any of the three tricks arbitrary number of times: $i)$ switch $1$ plum and $1$ pear with $2$ apples $ii)$ switch $1$ pear and $1$ apple with $3$ plums $iii)$ switch $1$ apple and $1$ plum with $4$ pears In the beginning, Harry had $2012$ of plums, apples and pears, each. Harry did some tricks and now he has $2012$ apples, $2012$ pears and more than $2012$ plums. What is the minimal number of plums he can have?