cf 254 div2, wasted lot of time on easy B