Is there a exponential price increase for Product Variants?

I want to have a product with two variant groups that define it’s variants and those variants prices, Group A and Group B. Group A causes a linear increase in the products price ie the product can be ordered in regular for 20 Euros or as the Large size variant increasing the price by 3 Euros to be 23 Euros. This I know how to do. What I don’t know if I can do or how to do it is haveing Group B exponentially increase the price accounting for the change in Group A ie Product costs = 20 Euro, Add 3 Euro from change to Large size = 23 Euro, Inside a 3 pack = 69 Euro. To simplify (20+A)*B . Is it possible to do this using Variant Configuration?