Agero Interview Question

Derive a mathematical formula for a given scenario and then write a pseudo code