BairesDev interview question

Basic logic and math exercises