AB comparison

View as PDF

Submit solution

Points: 100.00 (partial)
Time limit: 0.2s
Memory limit: 64M
Input: stdin
Output: stdout

Author:
Problem source:
My kitchen
Problem type

Cho q truy vấn, xử lý các truy vấn như sau:

Với mỗi truy vấn, cho 4 số a,b,c,d. Bạn cần kiểm tra xem số nào lớn hơn trong hai số abcd.

Input

  • Dòng đầu tiên chứa một số nguyên dương q (q105).
  • q dòng sau, mỗi dòng chứa 4 số nguyên dương a,b,c,d (2a,b,c,d106).

Output

  • Gồm q dòng, dòng thứ i thể hiện cho truy vấn thứ i. Cụ thể, nếu aibi>cidi thì in ra Greater, ngược lại nếu aibi<cidi thì in ra Lesser.
  • Dữ liệu đảm bảo rằng không có bộ a,b,c,d nào mà aibi=cidi.

Sample Input

Copy
3
2 4 3 2
2 5 3 4
4 2 5 2

Sample Output

Copy
Greater
Lesser
Lesser

Notes

24=16>32=9 nên in ra Greater.

25=32<34=81 nên in ra Lesser.

42=16<52=25 nên in ra Lesser.

Scoring

Subtask Điểm Giới hạn
1 20 a,b,c,d10
2 20 a,b,c,d,q100
3 60 Không ràng buộc gì thêm

Comments

Please read the guidelines before commenting.



  • 1
    UltimateWiener  commented 4:47:36 am, 15/01/2024

    Test cho subtask 2 đã được cập nhật lại, whoops.