Treatment of IRA RMD for Part Time Resident of two States

My wife and I recently moved from California to Montana on July 31, 2023.  My question is how is the Required Minimum Distribution (RMD) of my IRA treated for 2023 as a result of the move?

Do I   (1.)  Divide the distribution between the two states proportional to our residential duration, i.e., 7/12ths for CA and 5/12ths for MT, or (2.)  Apply the entire distribution to one state, and none to the other.  If so, which state receives the entire distribution.  The RMD was earned and calculated while being a resident of CA, but will be entirely dispursed while a resident of MT.