solved C from div2