Pergunta de entrevista da empresa CGI

There was a logics/math trick question