{"raw_statement":[{"iden":"problem statement","content":"There are $N$ bags, each containing two white balls. The $i$\\-th box contains two balls with integers $x_i$ and $y_i$ written on them, respectively.\nFor each of these bags, you will paint one of the balls red, and paint the other blue.\nAfterwards, the $2N$ balls will be classified according to color.\nThen, we will define the following:\n\n*   $R_{max}$: the maximum integer written on a ball painted in red\n*   $R_{min}$: the minimum integer written on a ball painted in red\n*   $B_{max}$: the maximum integer written on a ball painted in blue\n*   $B_{min}$: the minimum integer written on a ball painted in blue\n\nFind the minimum possible value of $(R_{max} - R_{min}) \\times (B_{max} - B_{min})$."},{"iden":"constraints","content":"*   $1 ≤ N ≤ 200,000$\n*   $1 ≤ x_i, y_i ≤ 10^9$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$x_1$ $y_1$\n$x_2$ $y_2$\n:\n$x_N$ $y_N$"},{"iden":"sample input 1","content":"3\n1 2\n3 4\n5 6"},{"iden":"sample output 1","content":"15\n\nThe optimal solution is to paint the balls with $x_1$, $x_2$, $y_3$ red, and paint the balls with $y_1$, $y_2$, $x_3$ blue."},{"iden":"sample input 2","content":"3\n1010 10\n1000 1\n20 1020"},{"iden":"sample output 2","content":"380"},{"iden":"sample input 3","content":"2\n1 1\n1000000000 1000000000"},{"iden":"sample output 3","content":"999999998000000001"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}