Pregunta de entrevista de Optiver

Basic arithmetic but most be solved very quickly