Can you connect two lm317's either in series or parallel to help spread out heat?
A couple of suggestions.

Forget about the LM317. Consider a DC-DC converter instead. There are a lot of choices that can work.

Arrange your resistor selection to be in series. Your approach could set a higher voltage than you intend if more than one switch is on.


If you are concerned about DC-DC ripple, you can post-regulate with an LDO (not the 317 - it has a high overhead), which is also where you would do a fine adjust.