fixed Problem_C from Codeforces round 279 div 2