Conver problem18 to cmake