{"problem":{"name":"[ICPC 2020 Shanghai R] Octasection","description":{"content":" At the Namomo Camp, a cute volunteer celebrates her birthday. Wowo buys her a huge cake. (The cake is so big that it has a 3D coordinate system inside.) There are $n$ cuboid shaped pieces of chocolat","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":3000,"memory_limit":1048576},"difficulty":{"LuoguStyle":"P7"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGP9828"},"statements":[{"statement_type":"Markdown","content":"At the Namomo Camp, a cute volunteer celebrates her birthday. Wowo buys her a huge cake. (The cake is so big that it has a 3D coordinate system inside.) There are $n$ cuboid shaped pieces of chocolates $\\textbf{in}$ the cake. The $i$-th ($1\\le i\\le n$) chocolate consists of all points $(x,y,z)$ such that $min\\_x[i]\\le x\\le max\\_x[i], min\\_y[i]\\le y\\le max\\_y[i], min\\_z[i]\\le z\\le max\\_z[i]$. $min\\_x,max\\_x, min\\_y,max\\_y, min\\_z, max\\_z$ are $6$ arrays of integers. Chocolates may overlap or touch each other.\n\nThe volunteer wants to distribute the cake to the campers of the Namomo Camp. To show off his knife skill, Wowo decides to cut the cake into pieces by exactly $3$ cuts such that:\n\n- The first cut is a plane whose equation is $x=a$ for some integer $a$ decided by Wowo.\n- The second cut is a plane whose equation is $y=b$ for some integer $b$ decided by Wowo.\n- The third cut is a plane whose equation is $z=c$ for some integer $c$ decided by Wowo.\n- Each chocolate is $\\textbf{touched}$ by at least one cut (i.e. each cuboid has a nonempty intersection with at least one plane).\n\nDecide whether Wowo can cut the cake under the rules. If the answer is yes, output any possible solution.\n\n## Input\n\nThe first line contains a single integer $n$ ($1\\le n\\le 100000$).\n\nThe $i$-th line of the next $n$ lines contains $6$ integers $min\\_x[i],max\\_x[i], min\\_y[i],max\\_y[i], min\\_z[i], max\\_z[i]$ ($-10^9\\le min\\_x[i],max\\_x[i], min\\_y[i],max\\_y[i], min\\_z[i], max\\_z[i]\\le 10^9$, $min\\_x[i]<max\\_x[i]$, $min\\_y[i]<max\\_y[i]$, $min\\_z[i]< max\\_z[i]$).\n\n## Output\n\nIf Wowo can cut the cake under the rules, the first line of the output should contain ``YES`` and the second line should contain $3$ integers $a$, $b$ and $c$ ($-10^9\\le a, b, c\\le 10^9$). If Wowo cannot cut the cake under the rules, output only one line containing ``NO``.\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"LGP9828","tags":["2020","线段树","上海","Special Judge","O2优化","ICPC"],"sample_group":[["3\n0 1 0 1 0 1\n10 11 10 11 10 11\n999999999 1000000000 999999999 1000000000 999999999 1000000000","YES\n0 10 999999999"],["4\n0 1 0 1 0 1\n999999999 1000000000 0 1 0 1\n0 1 999999999 1000000000 0 1\n0 1 0 1 999999999 1000000000","YES\n0 0 0"]],"created_at":"2026-03-03 11:09:25"}}