{"problem":{"name":"Movies","description":{"content":"Maroon's summer vacation lasts $N$ days from Day $1$ through Day $N$. During the vacation, $M$ movies numbered from $1$ through $M$ are scheduled to be screened, and movie $i$ can be watched from Day ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":4000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"awtf2025_b"},"statements":[{"statement_type":"Markdown","content":"Maroon's summer vacation lasts $N$ days from Day $1$ through Day $N$. During the vacation, $M$ movies numbered from $1$ through $M$ are scheduled to be screened, and movie $i$ can be watched from Day $L_i$ through Day $R_i$.\nFor a subset $s$ of all movies, define $f(s)$ as follows:\n\n*   $f(s)$ is the maximum number of movies in $s$ that can be watched throughout the vacation when he can watch at most one movie per day. Here, watching the same movie multiple times counts as one movie.\n\nThere are $2^M$ possible sets for $s$. Find the sum, modulo $998244353$, of $f(s)$ over all of them.\n\n## Constraints\n\n*   $1 \\leq N \\leq 100$\n*   $1 \\leq M \\leq N \\times (N+1) /2$\n*   $1 \\leq L_i \\leq R_i \\leq N$\n*   $(L_i,R_i) \\neq (L_j,R_j)$ ($i \\neq j$)\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $M$\n$L_1$ $R_1$\n$L_2$ $R_2$\n$\\vdots$\n$L_M$ $R_M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"awtf2025_b","tags":[],"sample_group":[["2 3\n1 1\n2 2\n1 2","11\n\n$f(s)=|s|$ holds for most $s$. The only exception is $s={1,2,3}$, where $f(s)=2$. The sum of $f(s)$ over all $s$ is $11$."],["3 3\n1 1\n2 2\n3 3","12"],["4 10\n3 3\n2 4\n2 3\n4 4\n3 4\n1 3\n1 1\n2 2\n1 2\n1 4","3796"],["7 20\n1 3\n4 5\n3 3\n3 5\n1 4\n4 7\n2 3\n1 7\n6 7\n4 6\n2 4\n6 6\n3 6\n2 5\n7 7\n3 4\n2 2\n5 5\n2 6\n1 2","7113137"]],"created_at":"2026-03-03 11:01:13"}}