{"raw_statement":[{"iden":"problem statement","content":"We have a set $S$ of $N$ points in a two-dimensional plane. The coordinates of the $i$\\-th point are $(x_i, y_i)$. The $N$ points have distinct $x$\\-coordinates and distinct $y$\\-coordinates.\nFor a non-empty subset $T$ of $S$, let $f(T)$ be the number of points contained in the smallest rectangle, whose sides are parallel to the coordinate axes, that contains all the points in $T$. More formally, we define $f(T)$ as follows:\n\n*   $f(T) := $ (the number of integers $i$ $(1 \\leq i \\leq N)$ such that $a \\leq x_i \\leq b$ and $c \\leq y_i \\leq d$, where $a$, $b$, $c$, and $d$ are the minimum $x$\\-coordinate, the maximum $x$\\-coordinate, the minimum $y$\\-coordinate, and the maximum $y$\\-coordinate of the points in $T$)\n\nFind the sum of $f(T)$ over all non-empty subset $T$ of $S$. Since it can be enormous, print the sum modulo $998244353$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $-10^9 \\leq x_i, y_i \\leq 10^9$\n*   $x_i \\neq x_j (i \\neq j)$\n*   $y_i \\neq y_j (i \\neq j)$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$x_1$ $y_1$\n$:$\n$x_N$ $y_N$"},{"iden":"sample input 1","content":"3\n-1 3\n2 1\n3 -2"},{"iden":"sample output 1","content":"13\n\nLet the first, second, and third points be $P_1$, $P_2$, and $P_3$, respectively. $S = {P_1, P_2, P_3}$ has seven non-empty subsets, and $f$ has the following values for each of them:\n\n*   $f({P_1}) = 1$\n*   $f({P_2}) = 1$\n*   $f({P_3}) = 1$\n*   $f({P_1, P_2}) = 2$\n*   $f({P_2, P_3}) = 2$\n*   $f({P_3, P_1}) = 3$\n*   $f({P_1, P_2, P_3}) = 3$\n\nThe sum of these is $13$."},{"iden":"sample input 2","content":"4\n1 4\n2 1\n3 3\n4 2"},{"iden":"sample output 2","content":"34"},{"iden":"sample input 3","content":"10\n19 -11\n-3 -12\n5 3\n3 -15\n8 -14\n-9 -20\n10 -9\n0 2\n-7 17\n6 -6"},{"iden":"sample output 3","content":"7222\n\nBe sure to print the sum modulo $998244353$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}