cf 250 div2, wasted too much time on B, think ,prove, and then code