{"problem":{"name":"F. Mobile Communications","description":{"content":"A sum of _p_ rubles is charged from Arkady's mobile phone account every day in the morning. Among the following _m_ days, there are _n_ days when Arkady will top up the account: in the day _d__i_ he w","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF926F"},"statements":[{"statement_type":"Markdown","content":"A sum of _p_ rubles is charged from Arkady's mobile phone account every day in the morning. Among the following _m_ days, there are _n_ days when Arkady will top up the account: in the day _d__i_ he will deposit _t__i_ rubles on his mobile phone account. Arkady will always top up the account before the daily payment will be done. There will be no other payments nor tops up in the following _m_ days.\n\nDetermine the number of days starting from the 1\\-st to the _m_\\-th such that the account will have a negative amount on it after the daily payment (i. e. in evening). Initially the account's balance is zero rubles.\n\n## Input\n\nThe first line contains three integers _n_, _p_ and _m_ (1 ≤ _n_ ≤ 100 000, 1 ≤ _p_ ≤ 109, 1 ≤ _m_ ≤ 109, _n_ ≤ _m_) — the number of days Arkady will top up the account, the amount of the daily payment, and the number of days you should check.\n\nThe _i_\\-th of the following _n_ lines contains two integers _d__i_ and _t__i_ (1 ≤ _d__i_ ≤ _m_, 1 ≤ _t__i_ ≤ 109) — the index of the day when Arkady will make the _i_\\-th top up, and the amount he will deposit on this day. It is guaranteed that the indices of the days are distinct and are given in increasing order, i. e. _d__i_ > _d__i_ - 1 for all _i_ from 2 to _n_.\n\n## Output\n\nPrint the number of days from the 1\\-st to the _m_\\-th such that the account will have a negative amount on it after the daily payment.\n\n[samples]\n\n## Note\n\nIn the first example the balance will change as following (remember, initially the balance is zero):\n\n1.  in the first day 6 rubles will be charged, the balance in the evening will be equal to  - 6;\n2.  in the second day Arkady will deposit 13 rubles, then 6 rubles will be charged, the balance in the evening will be equal to 1;\n3.  in the third day 6 rubles will be charged, the balance in the evening will be equal to  - 5;\n4.  in the fourth day Arkady will deposit 20 rubles, then 6 rubles will be charged, the balance in the evening will be equal to 9;\n5.  in the fifth day 6 rubles will be charged, the balance in the evening will be equal to 3;\n6.  in the sixth day 6 rubles will be charged, the balance in the evening will be equal to  - 3;\n7.  in the seventh day Arkady will deposit 9 rubles, then 6 rubles will be charged, the balance in the evening will be equal to 0.\n\nThus, in the end of the first, third and sixth days the balance will be negative in the end of the day.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"[{\"iden\":\"statement\",\"content\":\"每天早上，Arkady 的手机账户会被扣除 #cf_span[p] 卢布。在接下来的 #cf_span[m] 天中，有 #cf_span[n] 天 Arkady 会为账户充值：在第 #cf_span[di] 天，他会向账户存入 #cf_span[ti] 卢布。Arkady 总是在每日扣款前完成充值。在接下来的 #cf_span[m] 天内，不会有其他扣款或充值。\\n\\n请确定从第 #cf_span[1] 天到第 #cf_span[m] 天中，有多少天在每日扣款后（即傍晚）账户余额为负数。初始时账户余额为 0 卢布。\"}},{\"iden\":\"input\",\"content\":\"第一行包含三个整数 #cf_span[n], #cf_span[p] 和 #cf_span[m]（#cf_span[1 ≤ n ≤ 100 000], #cf_span[1 ≤ p ≤ 109], #cf_span[1 ≤ m ≤ 109], #cf_span[n ≤ m]）——分别表示 Arkady 充值的天数、每日扣款金额和需要检查的天数。\\n\\n接下来的 #cf_span[n] 行中，第 #cf_span[i] 行包含两个整数 #cf_span[di] 和 #cf_span[ti]（#cf_span[1 ≤ di ≤ m], #cf_span[1 ≤ ti ≤ 109]）——表示 Arkady 第 #cf_span[i] 次充值的日期和充值金额。保证所有充值日期互不相同，且按递增顺序给出，即对所有 #cf_span[i] 从 #cf_span[2] 到 #cf_span[n]，有 #cf_span[di > di - 1]。\"},{\"iden\":\"output\",\"content\":\"输出从第 #cf_span[1] 天到第 #cf_span[m] 天中，在每日扣款后账户余额为负数的天数。\"},{\"iden\":\"examples\",\"content\":\"输入\\n3 6 7\\n2 13\\n4 20\\n7 9\\n输出\\n3\\n\\n输入\\n5 4 100\\n10 70\\n15 76\\n21 12\\n30 100\\n67 85\\n输出\\n26\"},{\"iden\":\"note\",\"content\":\"在第一个例子中，余额变化如下（初始余额为 0）：\\n\\n第一天：扣除 #cf_span[6] 卢布，傍晚余额为 #cf_span[ - 6]；\\n第二天：Arkady 存入 #cf_span[13] 卢布，然后扣除 #cf_span[6] 卢布，傍晚余额为 #cf_span[1]；\\n第三天：扣除 #cf_span[6] 卢布，傍晚余额为 #cf_span[ - 5]；\\n第四天：Arkady 存入 #cf_span[20] 卢布，然后扣除 #cf_span[6] 卢布，傍晚余额为 #cf_span[9]；\\n第五天：扣除 #cf_span[6] 卢布，傍晚余额为 #cf_span[3]；\\n第六天：扣除 #cf_span[6] 卢布，傍晚余额为 #cf_span[ - 3]；\\n第七天：Arkady 存入 #cf_span[9] 卢布，然后扣除 #cf_span[6] 卢布，傍晚余额为 #cf_span[0]。\\n\\n因此，在第一天、第三天和第六天结束时，余额为负。\"}]","is_translate":true,"language":"Chinese"}],"meta":{"iden":"CF926F","tags":[],"sample_group":[["3 6 7\n2 13\n4 20\n7 9","3"],["5 4 100\n10 70\n15 76\n21 12\n30 100\n67 85","26"]],"created_at":"2026-03-03 11:00:39"}}