finish problem C in contest 275