{"raw_statement":[{"iden":"statement","content":"Unfortunately, you have been sent to prison because you solved too many problems at CodeQuest 2021. Now, you're trying to break out. Your cell has a combination lock with $n$ dials. You're planning to try all of the possible combinations of the lock, and you want to know how many possible combinations the lock has.\n\nThe first line of input contains a positive integer $n$: the number of dials on the lock. The next $n$ lines each contain two space-separated integers: the lower and upper limits of each lock dial. For example, if the lower and upper limits were $3$ and $7$, respectively, then the lock dial could turn to 3, 4, 5, 6, or 7.\n\nOutput a single integer $c$: the total number of possible lock combinations.\n\n"},{"iden":"input","content":"The first line of input contains a positive integer $n$: the number of dials on the lock. The next $n$ lines each contain two space-separated integers: the lower and upper limits of each lock dial. For example, if the lower and upper limits were $3$ and $7$, respectively, then the lock dial could turn to 3, 4, 5, 6, or 7."},{"iden":"output","content":"Output a single integer $c$: the total number of possible lock combinations."},{"iden":"examples","content":"Input4\n2 10\n3 9\n11 16\n5 8\nOutput1512\nInput3\n1 2\n1 3\n11 12\nOutput12\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of dials.  \nFor each dial $ i \\in \\{1, \\dots, n\\} $, let $ [l_i, u_i] \\subseteq \\mathbb{Z} $ denote the range of possible values, where $ l_i $ and $ u_i $ are the lower and upper limits, respectively.\n\n**Constraints**  \nFor each $ i \\in \\{1, \\dots, n\\} $:  \n$ l_i \\leq u_i $\n\n**Objective**  \nCompute the total number of combinations:  \n$$\nc = \\prod_{i=1}^{n} (u_i - l_i + 1)\n$$","simple_statement":"Count all possible combinations of an n-dial lock, where each dial has a range of values. Multiply the number of choices for each dial.","has_page_source":false}