Pergunta de entrevista da empresa Viridien

several math problems, plus PHP and MySQL coding