AT_past17_m 長方形
Description
There are two rectangles A and B on a coordinate plane, each moving at a constant velocity in parallel translation.
Each side of each rectangle is parallel to $ x $ or $ y $ axis. At time $ t $ ,
the bottom-left and top-right vertices of rectangle A are at $ (U_1\times t+P_1,V_1\times t+Q_1) $ and $ (U_1\times t+R_1,V_1\times t+S_1) $ , respectively;
the bottom-left and top-right vertices of rectangle B are at $ (U_2\times t+P_2,V_2\times t+Q_2) $ and $ (U_2\times t+R_2,V_2\times t+S_2) $ , respectively.
Here, it is guaranteed that $ (U_1,V_1)\neq (U_2, V_2) $ .
Between time $ 0 $ and time $ t=10^{100} $ , find the duration that rectangles A and B overlap; in other words, the intersection of the two rectangles has a positive area.
Input Format
The input is given from Standard Input in the following format:
> $ P_1 $ $ Q_1 $ $ R_1 $ $ S_1 $ $ U_1 $ $ V_1 $ $ P_2 $ $ Q_2 $ $ R_2 $ $ S_2 $ $ U_2 $ $ V_2 $
Output Format
Print the duration that the intersection of the two rectangles has a positive area.
Your answer is considered correct if the relative or absolute error from the correct value is at most $ 10^{-7} $ .
Explanation/Hint
### Sample Explanation 1
The two rectangles overlap between time $ t=1 $ and $ t=4 $ , but not otherwise. Thus, the duration of overlap is $ 3 $ .
### Sample Explanation 3
Note that when two rectangles only share sides or vertices, the area of the intersection is $ 0 $ , so they are not considered overlapping.
### Constraints
- $ -1000\leq P_i