HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Sorting and sequences > problem:


50339 - The Largest Rectangle

Guest
• Review clarifications (3)

Section problems

• 50311 - Student Line Up
• 50320 - Random Sorted List
• 50736 - Top N Donors - 2
• 50733 - The Highest Average
• 50364 - Student averages
• 50333 - Series of Squares
• 50734 - Product Info (In Srt)
• 50735 - Top M Products
• 50339 - The Largest Rectangle
• 50492 - Contest Scoreboard
• 50737 - Sum of the k-largest numbers
• 50418 - Student averages
• 50875 - Take m-out
• 50748 - Gold Store
• 50766 - Word Puzzle
• 50741 - DNA Distance
• 50934 - Selling Cars

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