Ship Damage!


Submit solution


Points:100 (partial)
Time limit:0.5s
Memory limit:32M
Author:

Tags
Math
Difficulty
Easy

Inside the sea (a standard Cartesian /rectangular/ coordinate system) we are given a ship \(S\) (a rectangle whose sides are parallel to the coordinate axes), a horizontal line \(H\) (the horizon) and three catapults, given as coordinates \(C_{1}\), \(C_{2}\) and \(C_{3}\) that will be used to fire the ship. When the attack starts, each catapult hits a projectile exactly into the positions that are symmetrical to \(C_{1}\), \(C_{2}\) and \(C_{3}\) with respect to the horizon \(H\). When a projectile hits some of the corners of the ship, it causes a damage of \(25\%\), when it hits some of the sides of the ship, the damage caused is \(50\%\) and when it hits the internal body of the ship, the damage is \(100\%\). When the projectile hit outside of the ship, there is no damage. The total damage is sum of the separate damages and can exceed \(100\%\).

At the figure below a sea, a ship \(S\), a line \(H\), three points \(C_{1}\), \(C_{2}\) and \(C_{3}\) and their hit positions are shown:

coordinate system

Your task is to write a program that calculates the total damage caused after the attack over the ship.

Input

  • Read from the standard input
  • There will be exactly \(11\) lines holding the integer numbers \(S_{X1}\), \(S_{Y1}\), \(S_{X2}\), \(S_{Y2}\), \(H\), \(-C_{X1}\), \(C_{Y1}\), \(C_{X2}\), \(C_{Y2}\), \(C_{X3}\), and \(C_{Y3}\). The ship \(S\) is given by any two of its opposite corners and is non-empty (has positive width and height). The line \(H\) is given by its vertical offset. The points \(C_{1}\), \(C_{2}\) and \(C_{3}\) are given as couples of coordinates and cannot overlap each other.
  • The input data will always be valid and in the format described. There is no need to check it explicitly.

Output

  • Print to the standard output.
  • The output should consist of a single line holding the total damage given as percentage.

Constraints

  • The numbers \(S_{X1}\), \(S_{Y1}\), \(S_{X2}\), \(S_{Y2}\), \(H\), \(C_{X1}\), \(C_{Y1}\), \(C_{X2}\), \(C_{Y2}\), \(C_{X3}\), and \(C_{Y3}\) are all integers between \(-100000\) and \(100000\), inclusive.

Sample tests

Input

-11
6
-6
3
1
-9
-3
-12
-4
-6
-1

Output

125%

Input

-6
6
-11
3
1
-9
-4
-11
-1
2
2

Output

75%

Comments