Cost minimizing input combination