HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Sorting and sequences > problem:


50339 - The Largest Rectangle

Guest
• Review clarifications (3)

Section problems

• 50733 - The Highest Average
• 50358 - Series of Odd Numbers
• 50756 - Average of the Nth Student
• 50347 - Selling Oranges
• 50758 - National Elections - Revisited
• 50757 - National Elections - 1
• 50755- Top N Donors - 1
• 50290 - Minimax Sum
• 50339 - The Largest Rectangle
• 50753 - Average of the Nth Student
• 50735 - Top M Products
• 50361 - Align Two Lists

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