Pergunta de entrevista da empresa Amazon

Math based question with simple calculations