Help me in solving AIRLINE problem

My issue

t=int(input())
for i in range (t):
(A,B,C,D,E)=map(int,input().split())
c=0
if (A+B or B+C or C+A)<=D:
c=c+1
if (A or B or C)<=E and (c==1) :
print(“YES”)
else:
print(“NO”)
why this code is not working for this problem?

My code

# cook your dish here
t=int(input())
for i in range (t):  
    (A,B,C,D,E)=map(int,input().split())
    c=0
    if (A+B or B+C or C+A)<=D:
       c=c+1
    if (A or B or C)<=E and (c==1) :
         print("YES")
    else:
         print("NO")
        
    

Problem Link: Airline Restrictions Practice Coding Problem - CodeChef

@dabbuguntaravi
plzz refer the following solution for better understanding

# cook your dish here
for i in range(int(input())):
    a,b,c,d,e=map(int,input().split())
    if(a+b<=d) and (c<=e):
        print("YES")
    elif(b+c<=d) and (a<=e):
        print("YES")
    elif(a+c<=d) and (b<=e):
        print("YES")
    else:
            print("NO")