Answer:
C. 31.25%.
Explanation:
PRODUCTS                   X               Y                 Z               Total 
Sales in dollars         $20,000   $40,000   $100,000     $160,000
CM ratio                     45%              40%           25%
Contribution margin ratio can be calculated by weighted average method base on the sales ratio of each product.
Contribution margin as a whole = ( CM ratio of X x Ratio of X in total sales ) + ( CM ratio of Y x Ratio of Y in total sales ) + ( CM ratio of Z x Ratio of Z in total sales ) 
Contribution margin as a whole = ( 45% x $20,000 / $160,000 ) + ( 40% x $40,000 / $160,000 ) + ( 25% x $100,000 / $160,000 ) 
Contribution margin as a whole = 5.625% + 10% + 15.625% = 31.25%