#K76287. Compare Perimeters of a Square and a Rectangle

    ID: 34609 Type: Default 1000ms 256MiB

Compare Perimeters of a Square and a Rectangle

Compare Perimeters of a Square and a Rectangle

You are given several test cases. In each test case, you are provided three integers: S, L, and W. Here, S represents the side length of a square, and L and W represent the length and the width of a rectangle respectively.

Your task is to determine which shape has a larger perimeter or if they are equal. The perimeter of the square is calculated as \(4S\) and the perimeter of the rectangle is calculated as \(2(L+W)\).

For each test case, output one of the following strings (each on a new line):

  • SQUARE if the perimeter of the square is greater than that of the rectangle.
  • RECTANGLE if the perimeter of the rectangle is greater than that of the square.
  • EQUAL if both perimeters are the same.

Follow the input and output format specified below.

inputFormat

The first line of the input contains an integer T, the number of test cases. Each of the following T lines contains three integers S, L, and W separated by spaces, where S is the side length of the square and L and W are the length and width of the rectangle, respectively.

outputFormat

For each test case, print a single line containing one of the following strings: SQUARE, RECTANGLE, or EQUAL, based on the comparison of the perimeters.

## sample
3
4 5 3
6 4 4
7 8 7
EQUAL

SQUARE RECTANGLE

</p>