#C3490. Total Reading Time

    ID: 46923 Type: Default 1000ms 256MiB

Total Reading Time

Total Reading Time

Sara is planning to read a book containing N pages. To finish the book faster, she reads M pages at triple her usual speed. For these pages, the time taken is equivalent to reading at 3 pages per time unit, using integer division; that is, the time taken for these pages is \(\lfloor \frac{M}{3} \rfloor\) time units. The remaining \(N - M\) pages are read at normal speed (one page per time unit).

Your task is to compute the total time Sara spends reading the book.

The formula for the total reading time is:

\( T = \left\lfloor \frac{M}{3} \right\rfloor + (N - M) \)

inputFormat

The input consists of a single line containing two space-separated integers:

  • N: total number of pages in the book.
  • M: number of pages read at triple the usual speed.

outputFormat

Output a single integer representing the total time (in time units) spent reading the book.

## sample
120 30
100