{"raw_statement":[{"iden":"problem statement","content":"We have $N$ continuous random variables $X_1,X_2,\\dots,X_N$. $X_i$ has a continuous uniform distribution over the interval $\\lbrack L_i, R_i \\rbrack$.  \nLet $E$ be the expected value of the $K$\\-th greatest value among the $N$ random variables. Print $E \\bmod {998244353}$ as specified in Notes."},{"iden":"notes","content":"In this problem, we can prove that $E$ is always a rational number. Additionally, the Constraints of this problem guarantee that, when $E$ is represented as an irreducible fraction $\\frac{y}{x}$, $x$ is indivisible by $998244353$.  \nHere, there uniquely exists an integer $z$ between $0$ and $998244352$ such that $xz \\equiv y \\pmod{998244353}$. Print this $z$ as the value $E \\bmod {998244353}$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 50$\n*   $1 \\leq K \\leq N$\n*   $0 \\leq L_i \\lt R_i \\leq 100$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$\n$L_1$ $R_1$\n$L_2$ $R_2$\n$\\vdots$\n$L_N$ $R_N$"},{"iden":"sample input 1","content":"1 1\n0 2"},{"iden":"sample output 1","content":"1\n\nThe answer is the expected value of the random variable with a continuous uniform distribution over the interval $\\lbrack 0, 2 \\rbrack$. Thus, we should print $1$."},{"iden":"sample input 2","content":"2 2\n0 2\n1 3"},{"iden":"sample output 2","content":"707089751\n\nThe answer represented as a rational number is $\\frac{23}{24}$. We have $707089751 \\times 24 \\equiv 23 \\pmod{998244353}$, so we should print $707089751$."},{"iden":"sample input 3","content":"10 5\n35 48\n44 64\n47 59\n39 97\n36 37\n4 91\n38 82\n20 84\n38 50\n39 69"},{"iden":"sample output 3","content":"810056397"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}