{"problem":{"name":"051. The Convergence of Two Tetra-sided Polygons, Known as Rectangles","description":{"content":"You will be given two opposite corners of two separate rectangles and you must determine whether they intersect or not. The first line will contain 4 integers separated by spaces, which respectively ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269051"},"statements":[{"statement_type":"Markdown","content":"You will be given two opposite corners of two separate rectangles and you must determine whether they intersect or not.\n\nThe first line will contain 4 integers separated by spaces, which respectively represent the x-coordinate and y-coordinate of a corner of the rectangle and the x-coordinate and y-coordinate of the opposite corner. The second line will contain another 4 integers that represent the same coordinates but for the second rectangle.\n\nPrint \"YES\" (without the quotes) if the rectangles intersect or \"NO\" (without the quotes) if the rectangles do not intersect.\n\nThe first rectangle has one corner located at (-5,-5) and the opposite corner at (5,5). The second rectangle has one corner located at (4,4) and the opposite corner at (8,8). These rectangles intersect, thus \"YES\" is printed\n\nAlso, if the rectangles lie on top of one another, they are intersecting. If one is inside the other and their perimeters do not touch, then they are not intersecting.\n\n## Input\n\nThe first line will contain 4 integers separated by spaces, which respectively represent the x-coordinate and y-coordinate of a corner of the rectangle and the x-coordinate and y-coordinate of the opposite corner. The second line will contain another 4 integers that represent the same coordinates but for the second rectangle.\n\n## Output\n\nPrint \"YES\" (without the quotes) if the rectangles intersect or \"NO\" (without the quotes) if the rectangles do not intersect.\n\n[samples]\n\n## Note\n\nThe first rectangle has one corner located at (-5,-5) and the opposite corner at (5,5). The second rectangle has one corner located at (4,4) and the opposite corner at (8,8). These rectangles intersect, thus \"YES\" is printedAlso, if the rectangles lie on top of one another, they are intersecting. If one is inside the other and their perimeters do not touch, then they are not intersecting.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ R_1 = [x_{1,\\min}, x_{1,\\max}] \\times [y_{1,\\min}, y_{1,\\max}] $ and $ R_2 = [x_{2,\\min}, x_{2,\\max}] \\times [y_{2,\\min}, y_{2,\\max}] $ be two axis-aligned rectangles, where:  \n- $ x_{1,\\min} = \\min(a_1, a_3) $, $ x_{1,\\max} = \\max(a_1, a_3) $,  \n- $ y_{1,\\min} = \\min(a_2, a_4) $, $ y_{1,\\max} = \\max(a_2, a_4) $,  \n- $ x_{2,\\min} = \\min(b_1, b_3) $, $ x_{2,\\max} = \\max(b_1, b_3) $,  \n- $ y_{2,\\min} = \\min(b_2, b_4) $, $ y_{2,\\max} = \\max(b_2, b_4) $,  \nwith input coordinates $ (a_1, a_2, a_3, a_4) $ for $ R_1 $ and $ (b_1, b_2, b_3, b_4) $ for $ R_2 $.\n\n**Constraints**  \nAll coordinates are integers.\n\n**Objective**  \nDetermine whether $ R_1 \\cap R_2 \\neq \\emptyset $.  \nThat is, output \"YES\" if:  \n$$\n\\max(x_{1,\\min}, x_{2,\\min}) \\le \\min(x_{1,\\max}, x_{2,\\max}) \\quad \\text{and} \\quad \\max(y_{1,\\min}, y_{2,\\min}) \\le \\min(y_{1,\\max}, y_{2,\\max})\n$$  \nOtherwise, output \"NO\".","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269051","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}