{"problem":{"name":"M. Ahmad Jaber Rectangles","description":{"content":"Ahmad has two rectangles, both of them are above $x -a x i s$ and the height of each one is $h$ $(1 <= h <= 10^9)$. The first rectangle's sides are $(x_1, 0)$ $(x_2, 0)$ $(x_1, h)$ $(x_2, h)$ The se","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10203M"},"statements":[{"statement_type":"Markdown","content":"Ahmad has two rectangles, both of them are above $x -a x i s$ and the height of each one is $h$ $(1 <= h <= 10^9)$.\n\nThe first rectangle's sides are $(x_1, 0)$ $(x_2, 0)$ $(x_1, h)$ $(x_2, h)$\n\nThe second rectangle's sides are $(x_3, 0)$ $(x_4, 0)$ $(x_3, h)$ $(x_4, h)$\n\nAhmad wants to know what is the area of the intersection between these two rectangles.\n\nThe first and the only line of input contains 5 integers $x_1$,$x_2$,$x_3$,$x_4$ and $h$ \n\n$(1 <= x_1 < x_2 <= 10^9)$ $(1 <= x_3 < x_4 <= 10^9)$ $(1 <= h <= 10^9)$.\n\nPrint the area of intersection.\n\n## Input\n\nThe first and the only line of input contains 5 integers $x_1$,$x_2$,$x_3$,$x_4$ and $h$ $(1 <= x_1 < x_2 <= 10^9)$ $(1 <= x_3 < x_4 <= 10^9)$ $(1 <= h <= 10^9)$.\n\n## Output\n\nPrint the area of intersection.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ x_1, x_2, x_3, x_4, h \\in \\mathbb{Z} $ be given integers such that:  \n- $ 1 \\le x_1 < x_2 \\le 10^9 $  \n- $ 1 \\le x_3 < x_4 \\le 10^9 $  \n- $ 1 \\le h \\le 10^9 $  \n\nLet $ R_1 = [x_1, x_2] \\times [0, h] $ and $ R_2 = [x_3, x_4] \\times [0, h] $ be two axis-aligned rectangles.\n\n**Objective**  \nCompute the area of the intersection $ R_1 \\cap R_2 $:  \n$$\n\\text{Area} = h \\cdot \\max(0, \\min(x_2, x_4) - \\max(x_1, x_3))\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10203M","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}