My issue
i got time limit exceed
My code
import java.io.*;
import java.util.*;
class codechef{
public static void main(String [] args){
Scanner sc= new Scanner(System.in);
int T = sc.nextInt();
for (int t =0 ;t<T;t++)
{
int a =sc.nextInt();
int b = sc.nextInt();
int c= sc.nextInt();
int d= sc.nextInt();
int k =sc.nextInt();
int dis = Math.abs(c-a)+Math.abs(d-b);
if(dis<=k)
{
if ((k-dis)%2 ==0)
{
System.out.println("YES");
}
else{
System.out.println("NO");
}
}
}
sc.close();
}
}
Learning course: Roadmap to 3*
Problem Link: https://www.codechef.com/learn/course/klu-roadmap-3star/KLURMP301/problems/TANDJ1