Codeforces Problem 166C: Median