HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN112 Homeworks 2013-2015 > problem:


50339 - The Largest Rectangle

CEN112 Homeworks 2013-2015

Start: Dec.15.2013 at 12:00:00 PM
Finish: Dec.15.2013 at 05:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (3)

Contest problems

• 50530 - Sum of Ratios
• 50375 - Area of Circles
• 50388 - Number of Armstrong Num...
• 50393 - Palindromic Numbers
• 50339 - The Largest Rectangle
• 50345 - Orders
• 50758 - National Elections - Revisited
• 50754 - Team Standings
• 12-Spr1-40. 50327 - Parallel Lines
• 13-Fall2-20. 50395 - Page "Like" Av...
• 14-Spr1-30. 50492 - Contest Score...
• 14-Spr1-40. 50538 - Sum of kth Dia...
• 14-Spr1-60. 50647 - Spiral

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