Help me in solving CONN problem

My issue

this problem falls in which category

My code

# cook your dish here
t = int(input())
for i in range(t):
    n = int(input())
    a = ((n % 7) % 2) and ((n % 2) % 7)
    if a != 0:

Problem Link: CONN Problem - CodeChef

Your logic is not right .
Your code will fail for cases like 15,17 etc;
the logic is .
all even number can be made from 2 and all odd number >=7 can be made from combination of 2’s and 7’s;
so the no answer will be for 1,3,5 only.

got the logic little later myself
thanks for the help though