An algorithm for a cutting-stock problem on a strip