Олимпиадный тренинг

Задача 33126. Old book


Задача

Темы:
A group of young archaeologists is working on excavations of the building of the ancient library. Summer
they found the remains of an old book and, having studied them, made the following conclusions.
The book contains several pages, each page contains either text or
illustration. The first k pages of the book contain illustrations for sure. All pages of the book
are numbered, but the page number is written only on pages containing text. Amount
page numbers with text is equal to s.
Unfortunately, neither the total number of pages in the book, nor the number of illustrations
failed to install. Nevertheless, young archaeologists were interested in the question, what
the minimum number of illustrations could be in the book.
For example, if k = 1 and s = 8, then the pages of the book could have the following contents
(the letter "T" indicates the page containing the text, and the letter "I" — the page containing the
illustration):
- AND T AND AND AND T, numbered pages 2 and 6, 4 illustrations;
- E&T&T, numbered pages 3 and 5, 3 illustrations;
- AND AND AND AND AND AND AND T, numbered page 8, 7 illustrations.
The minimum number of illustrations is 3.
It is required to write a program that, given integers k and s, determines
the minimum number of illustrations that could be in the book.

Input data format
The first line of the input contains an integer k (0 ≤ k ≤ 109).
The second line of the input contains an integer s (k + 1 ≤ s ≤ 1012).

Output format
It is required to output a single integer — minimum number of illustrations per
book.
Enter Output
1
8
3