Hw: check Fermat's theorem given user inputs