Playing with cards

Two test cases are not running plzz help me out

The numbers which are not divisible by a prime u should also check whether it is divisible by other prime or not.