cf 264 div2 - implementation, misunderstood the problem