The number of apples decreases by 1 after 1 trick of type B or C is performed, and increases by 2 after 1 trick of type A is performed. The number of grapes decreases by 1 after 1 trick of type A or B is performed, and increases by 4 after 1 trick of type C is performed. Suppose the magician used x tricks of type A, y tricks of type B and z tricks of type C to reach the situation where the numbers of apples and grapes are the same as their initial numbers, then we must have
y+z=2x,x+y=4z.
Since x,y,z are non-negative integers and at least one of x,y,z must be positive, we see that the solution of the simultaneous equation above must have the form (x,y,z)=(5k,7k,3k), where k is a positive integer. Since the number of oranges decreases by 1 after 1 trick of type A or C is performed and increases by 3 after 1 trick of type B is performed, the change of the number of oranges after 5k tricks of type A, 7k tricks of type B and 3k tricks of type C are performed is given by −5k+3×7k−3k=13k. k=1, then, gives the smallest possible number of oranges when the number is 2011 for both apples and grapes, which is 2011+13=2024.