Pergunta de entrevista da empresa Epic

Complex math problem involving Negative number calculations.