Pergunta de entrevista da empresa Optiver

Basic arithmetic but most be solved very quickly