{"problem":{"name":"B. Wet Boxes","description":{"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 t","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10079B"},"statements":[{"statement_type":"Markdown","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## Input\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\n## Output\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[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**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 $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10079B","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}