Let n be a fixed integer.
Kostya has a black box, such that if you put in exactly 2n+1 coins of distinct weights, the box will expose the coin of median weight.
The teacher gave Kostya 4n+1 coins of distinct weights and told him which coin has the median weight.
Can Kostya check whether the teacher is right, using the box not more than n+2 times?
Source : Russian Euler contest 2012
Rem: Note that Kostya can't just put 4n+1 coins in the box.
The box accepts exactly 2n+1 coins.
Hint: start with n = 1. .