Custom product pricing based on number input

Hi,

My client sells products with unique (X x Y cm) sizes. Is it possible somehow to adjust the price of the product based on the size parameters that the user typed in? Here is a basic example:

(Options field doesn’t work because there would be hundreds of variants for every size)