Pregunta de entrevista de Amazon

basic interview and math question about allocating resource.