Codeforce 344 problem A