Contest Round #226 Div 2

A and B are correct and passed system tests. C is incorrect and was not
able to pass prelim tests.