WA in RECTANGL

Problem Link: https://www.codechef.com/problems/RECTANGL
Here’s my code in Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

class Rectangle
{
	public static void main(String[] args)
	{
		FastReader in = new FastReader();
		int T = in.nextInt();
		int s[] = new int[4];

		while(T-- > 0)
		{

			for(int i=0 ; i<4 ; i++)
				s[i] = in.nextInt();

			Arrays.sort(s);
			System.out.println((s[0]==s[1] && s[1]!=s[2] && s[2]==s[3])?"YES":"NO");
		}
	}

	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
        
        FastReader(){br=new BufferedReader(new InputStreamReader(System.in));}
        
        String next()
        {
            while(st==null || !st.hasMoreElements())
            try{st=new StringTokenizer(br.readLine());}catch(Exception e){}
            return st.nextToken();
        }
        int nextInt(){return Integer.parseInt(next());}
    }
}

It’s showing WA, but I can’t find such a case.
Please help!
Thank You!

Every square is a rectangle too.
Try:
1
1 1 1 1

2 Likes

But why is every square a rectangle?
Sides are the only thing which makes them different.

Edit:
Okay I searched about it, it is true

Thanks!

1 Like