Postindustria Interview Question

Solve difficult problem more related to math than programming.