With so few combinations it’s possible to precompute the values for each scenario by hand then quickly look them up for each game.