#B4300. Reading Progression in a Book

    ID: 11956 Type: Default 1000ms 256MiB

Reading Progression in a Book

Reading Progression in a Book

A book has n pages. Xiao Ming plans to read x pages on the first day, and each subsequent day he reads y pages more than the previous day. In other words, on the i-th day, he reads:

\( x + (i-1) \times y \)

The total number of pages read in d days is given by:

\( S = d \times x + \frac{y \times d \times (d-1)}{2} \)

Your task is to determine the minimum number of days required for Xiao Ming to finish reading all n pages of the book.

inputFormat

The input consists of three space-separated integers: n, x, and y, where:

  • n (\(1 \leq n \leq 10^9\)) represents the total number of pages in the book.
  • x (\(1 \leq x \leq 10^9\)) represents the number of pages read on the first day.
  • y (\(0 \leq y \leq 10^9\)) represents the additional number of pages read on each subsequent day compared to the previous day.

outputFormat

Output a single integer representing the minimum number of days required to finish reading the book.

sample

100 10 5
5