multiple cases
print all optimal solutions