Do you really need Artificial Intelligence for this class of problems? All right, it's for educational reasons...