{"problem":{"name":"Greedy customers","description":{"content":"$N$ people are waiting in a single line in front of the Takahashi Store. The cash on hand of the $i$\\-th person from the front of the line is a positive integer $A_i$. Mr. Takahashi, the shop owner, h","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"codefestival_2016_qualB_d"},"statements":[{"statement_type":"Markdown","content":"$N$ people are waiting in a single line in front of the Takahashi Store. The cash on hand of the $i$\\-th person from the front of the line is a positive integer $A_i$.\nMr. Takahashi, the shop owner, has decided on the following scheme: He picks a product, sets a positive integer $P$ indicating its price, and shows this product to customers in order, starting from the front of the line. This step is repeated as described below.\nAt each step, when a product is shown to a customer, if price $P$ is equal to or less than the cash held by that customer at the time, the customer buys the product and Mr. Takahashi ends the current step. That is, the cash held by the first customer in line with cash equal to or greater than $P$ decreases by $P$, and the next step begins.\nMr. Takahashi can set the value of positive integer $P$ independently at each step.\nHe would like to sell as many products as possible. However, if a customer were to end up with $0$ cash on hand after a purchase, that person would not have the fare to go home. Customers not being able to go home would be a problem for Mr. Takahashi, so he does not want anyone to end up with $0$ cash.\nHelp out Mr. Takahashi by writing a program that determines the maximum number of products he can sell, when the initial cash in possession of each customer is given.\n\n## Constraints\n\n*   $1 ≦ | N | ≦ 100000$\n*   $1 ≦ A_i ≦ 10^9(1 ≦ i ≦ N)$\n*   All inputs are integers.\n\n## Input\n\nInputs are provided from Standard Inputs in the following form.\n\n$N$\n$A_1$\n:\n$A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"codefestival_2016_qualB_d","tags":[],"sample_group":[["3\n3\n2\n5","3\n\nAs values of $P$, select in order $1, 4, 1$."],["15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9","18"]],"created_at":"2026-03-03 11:01:14"}}