HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > IMPC - 2013-2014 > problem:


2013-Nov-05. 50354 - Intersecting Rectangles

IMPC - 2013-2014

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

Guest
• Review clarifications (1)

Contest problems

• 2013-05-30. 50580 - Days passed
• 2013-05-40. 50553 - Divisible by m
• 2013-05-50. 50593 - Transporter
• 2013-12-10. 50352 - Selling Cows
• 2013-12-40. 50342 - 100 Factorial
• 2013-12-50. 50674 - Collecting Eggs
• 2013-Nov-01. 50328 - How far away
• 2013-Nov-02. 50347 - Selling Oranges
• 2013-Nov-05. 50354 - Intersect...

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.
Question by Ibrahim Mesecan.

Intersecting Rectangles

On XY plain, you are given upper left corner coordinate of two equal sized rectangles. Find the intersection percentage of the rectangles.

Question: Write a program that is going to read two rectangle information and find the intersection percentage.

Input specification
You will be first given the width (w) and height (h) of the rectangles. Then upper left coordinates (x, y) of the two rectangles are given in the following two lines where 0 ≤ (x, y) ≤ 10000 and 1 ≤ (w, h) ≤ 100.

Output specification
Show a floating point number with 3 decimal places that is the intersection percentage to the second rectangle.

Sample Input I
  4 3
  1 4
  3 5
Sample Input II
  2 9
  3 20
  11 20
Sample Output I
  33.333
Sample Output II
  0

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

www.contester.ru