Help me in solving WTRMIXING problem

My issue

Hey my code runs and shows correct but why does when I submit my code it’s shows wrong

My code

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
	Scanner sc=new Scanner(System.in);
	int t=sc.nextInt();
		for(int i=1;i<=t;i++)
		{
		  int a=sc.nextInt();
		  int b=sc.nextInt();
		  int m=sc.nextInt();
		  int n=sc.nextInt();
		  int temp=a-b;
		  if(temp<0)
		  {
		    if((temp*-1)<m)
		    {
		     System.out.println("yes");
		    }
		    else
		    {
		      System.out.println("no");
		    }
		  }
		  else if(temp>0)
		  {
		    if(temp<n)
		    {
		     System.out.println("yes");
		    }
		    else
		    {
		      System.out.println("No");
		    }
		  }
		  else
		  {
		    System.out.println("yes");
		  }
		}
	}
}

Problem Link: WTRMIXING Problem - CodeChef

@reddytanuj7
u have to put temp<=n and (temp*-1) <=m coz it holds equality too.

1 Like