Optimal licensing of cost-reducing innovation