JU Flash Contest |
---|
Finished |
Ahmad has two rectangles, both of them are above $$$x-axis$$$ and the height of each one is $$$h$$$ $$$(1 \leq h \leq 10^{9})$$$.
The first rectangle's sides are $$$(x_1,0)$$$ $$$(x_2,0)$$$ $$$(x_1,h)$$$ $$$(x_2,h)$$$
The second rectangle's sides are $$$(x_3,0)$$$ $$$(x_4,0)$$$ $$$(x_3,h)$$$ $$$(x_4,h)$$$
Ahmad wants to know what is the area of the intersection between these two rectangles.
The first and the only line of input contains 5 integers $$$x_1$$$,$$$x_2$$$,$$$x_3$$$,$$$x_4$$$ and $$$h$$$
$$$(1 \leq x_1 < x_2 \leq 10^{9})$$$ $$$(1 \leq x_3 < x_4 \leq 10^{9})$$$ $$$(1 \leq h \leq 10^{9})$$$.
Print the area of intersection.
1 4 2 3 5
5
Name |
---|