Question d’entretien chez Impero Software

Two easy to medium coding tasks to implement in C++. Two math/intelligence related question.