Pregunta de entrevista de Dolby

a maths problem and 2 programming problem.