HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Object Oriented Programming > problem:


50339 - The Largest Rectangle

Guest
• Review clarifications (3)

Volume problems

• 50346 - The Biggest Date
• 50992 - Top K Obese Classes
• 50991 - Intersecting Circles
• 50989 - Rectangles and Points
• 50984 - Top m hardworking employees
• 50269 - Matrix Determinant
• 50986 - The Oldest Person
• 170. 50327 - Parallel Lines
• 50339 - The Largest Rectangle
• 130. 50326 - Matrix Operations
• 180. 50325 - How much time passed?
• 50318 - Product Info

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Use Classes to solve the problem, Prepared by Ibrahim Mesecan.

The Largest Rectangle

Question:
You will be given the coordinates of two corners of n rectangles. Calculate and find the largest rectangle.

Input specification
In the first line, there will be an integer (n), the number of rectangles. Then in the following n lines, you will have 4 integers (x1, y1, x2, y2) where x1 and y1 are the coordinates of the first corner, and x2 and y2 are the coordinates of the second corner. The x, y coordinates are integers between -10000 and 10000 and 1 < n ≤ 20000.

Output specification
Give area of the largest rectangle
   area = abs(x1-x2) * abs(y1-y2)

Sample Input I
  4
  4 2 4 2
  1 3 5 1
  2 2 4 3
  1 1 1 2

Sample Output I  
  8
 Sample Input II
  8
  7 5 6 3
  4 3 4 5
  8 4 3 8
  8 7 5 4
  3 6 1 8
  7 6 6 3
  8 3 3 4
  3 6 3 2

 Sample Output II
  20

Для отправки решений необходимо выполнить вход.

www.contester.ru