Ameex interview question

some logical programs