codeforcesround#277.5(div.2)c.givenlengthand