My issue
def babba(k1,k2,k3,k4,p):
district=abs(k1-k3)+abs(k2-k4)
if district>p:
return “NO”
if(p-district)%2==0:
return “YES”
else:
return “NO”
talks=int(input())
for _ in range(talks):
k1,k2,k3,k4,p=map(int,input().split())
print(babba(k1,k2,k3,k4,p))
3
1 1 2 2 2
1 1 2 3 4
1 1 1 0 3
Sample Input
3
1 1 2 2 2
1 1 2 3 4
1 1 1 0 3
Wrong Answer: Failed on a hidden test case
Show me failed test cases
My code
def babba(k1,k2,k3,k4,p):
district=abs(k1-k3)+abs(k2-k4)
if district>p:
return "NO"
if(p-district)%2==0:
return "YES"
else:
return "NO"
talks=int(input())
for _ in range(talks):
k1,k2,k3,k4,p=map(int,input().split())
print(babba(k1,k2,k3,k4,p))
Learning course: Roadmap to 3*
Problem Link: https://www.codechef.com/learn/course/klu-roadmap-3star/KLURMP301/problems/TANDJ1