#include namespace { #pragma GCC diagnostic ignored "-Wunused-function" #include #pragma GCC diagnostic warning "-Wunused-function" using namespace std; using namespace atcoder; #define rep(i,n) for(int i = 0; i < (int)(n); i++) #define rrep(i,n) for(int i = (int)(n) - 1; i >= 0; i--) #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) template bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; } template bool chmin(T& a, const T& b) { if (b < a) { a = b; return true; } else return false; } using ll = long long; using P = pair; using VI = vector; using VVI = vector; using VL = vector; using VVL = vector; using mint = modint998244353; struct S { mint v00, v01, v11; }; S op(S x, S y) { return S{ x.v00 * y.v00, x.v01 * y.v11 + x.v00 * y.v01, x.v11 * y.v11}; } S e() { return S{1, 0, 1}; } } int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector

xy(n); for (auto& [x, y] : xy) cin >> x >> y; S up{3, 1, 4}, down{4, 0, 3}; mint ans; rep(_, 2) { for (auto& [x, y] : xy) swap(x, y); sort(all(xy)); vector ord(n); iota(ord.begin(), ord.end(), 0); sort(ord.begin(), ord.end(), [&](int i, int j) { return xy[i].second < xy[j].second; }); segtree seg(vector(n, up)); int pre = xy[ord[0]].second; mint tot = mint(4).pow(n); for (int i : ord) { auto [x, y] = xy[i]; auto s = seg.all_prod(); ans += (tot - (s.v00 + s.v01)) * (y - pre); seg.set(i, down); pre = y; } } ans *= 2; cout << ans.val() << '\n'; }