{"raw_statement":[{"iden":"problem statement","content":"We have a long piece of timber with a length of $L$ meters.  \nFor each $x = 1, 2, \\dots, L - 1$, there is a mark called Mark $x$ at $x$ meters from the left end of the piece.\nYou are given $Q$ queries, the $i$\\-th of which is represented as a pair of numbers $(c_i, x_i)$.  \nProcess the queries in ascending order of $i$ as described below.\n\n*   If $c_i = 1$: cut the piece at Mark $x_i$ into two.\n*   If $c_i = 2$: choose the piece with Mark $x_i$ on it and print its length.\n\nHere, for both kinds of queries $c_i = 1, 2$, it is guaranteed that there will have been no cut at Mark $x_i$ when the query is to be processed."},{"iden":"constraints","content":"*   $1 \\leq L \\leq 10^9$\n*   $1 \\leq Q \\leq 2 \\times 10^5$\n*   $c_i = 1, 2$ $(1 \\leq i \\leq Q)$\n*   $1 \\leq x_i \\leq L - 1$ $(1 \\leq i \\leq Q)$\n*   For every $i$ $(1 \\leq i \\leq Q)$, the following holds: there is no $j$ such that $1 \\leq j \\lt i$ and $(c_j,x_j) = (1, x_i)$.\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$L$ $Q$\n$c_1$ $x_1$\n$c_2$ $x_2$\n$\\vdots$\n$c_Q$ $x_Q$"},{"iden":"sample input 1","content":"5 3\n2 2\n1 3\n2 2"},{"iden":"sample output 1","content":"5\n3\n\nAt the time of the first query, no cut has been made, so the piece with Mark $2$ has a length of $5$ meters. Thus, you should print $5$.  \nIn the second query, the piece is cut into two pieces with lengths of $3$ and $2$ meters.  \nAt the time of the third query, the piece with Mark $2$ has a length of $3$ meters, so you should print $3$."},{"iden":"sample input 2","content":"5 3\n1 2\n1 4\n2 3"},{"iden":"sample output 2","content":"2"},{"iden":"sample input 3","content":"100 10\n1 31\n2 41\n1 59\n2 26\n1 53\n2 58\n1 97\n2 93\n1 23\n2 84"},{"iden":"sample output 3","content":"69\n31\n6\n38\n38"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}