3196. Maximize Total Cost of Alternating