add cutting a rod solution.