{"raw_statement":[{"iden":"statement","content":"Bob works in a warehouse which contains a large pile of boxes. The position of a box can be described with a pair of integers (x, y). Each box either stands on the ground (y = 0) or stands on top of two boxes with positions (x, y - 1) and (x + 1, y - 1) (see the figure). \n\nSometimes the contents of a box leak out and the box gets wet. When a box becomes wet, so do the two boxes below it. Given a list of boxes that leak in succession, help Bob count how many dry boxes became wet after each leak. Don't include boxes that were already wet.\n\nThe first line contains a single integer n, the number of leaking boxes (1 ≤ n ≤ 105). The i-th of the next n lines contains two space-separated integers xi and yi, the position of the i-th leaking box (0 ≤ xi, yi ≤ 109).\n\nOutput n lines: in the i-th line output the number of boxes that became wet after the i-th box had leaked.\n\n"},{"iden":"input","content":"The first line contains a single integer n, the number of leaking boxes (1 ≤ n ≤ 105). The i-th of the next n lines contains two space-separated integers xi and yi, the position of the i-th leaking box (0 ≤ xi, yi ≤ 109)."},{"iden":"output","content":"Output n lines: in the i-th line output the number of boxes that became wet after the i-th box had leaked."},{"iden":"examples","content":"Input41 33 20 61 1Output103150"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of leaking boxes.  \nLet $ L = \\{(x_i, y_i) \\mid i \\in \\{1, \\dots, n\\}\\} $ be the sequence of leaking box positions, where $ x_i, y_i \\in \\mathbb{Z}_{\\geq 0} $.  \n\nFor any box at position $ (x, y) $, define its *support set* as:  \n$$\nS(x, y) = \\left\\{ (x', y') \\in \\mathbb{Z}^2 \\mid y' \\leq y,\\ x' \\in [x - (y - y'), x + (y - y')] \\text{ and } x' + y' \\equiv x + y \\pmod{2} \\right\\}\n$$  \nThis represents all boxes that are directly or indirectly supported by $ (x, y) $, forming a downward triangular region.\n\nLet $ W \\subseteq \\mathbb{Z}^2 $ be the set of all wet boxes (initially empty).\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 10^5 $  \n2. $ 0 \\leq x_i, y_i \\leq 10^9 $ for all $ i \\in \\{1, \\dots, n\\} $\n\n**Objective**  \nFor each $ i \\in \\{1, \\dots, n\\} $, compute:  \n$$\nc_i = \\left| S(x_i, y_i) \\setminus W \\right|\n$$  \nthen update:  \n$$\nW \\leftarrow W \\cup S(x_i, y_i)\n$$  \nOutput $ c_i $ for each $ i $.","simple_statement":"Each time a box leaks, it makes itself and all boxes below it wet. Given a sequence of leaking boxes, count how many new dry boxes become wet after each leak.","has_page_source":false}