ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

NEERC, Central subregion, Rybinsk, October 2001

About     Problems     Submit solution     Judge status     Standings
Contest is over

F. Integer Percentage

Time limit: 1.0 second
Memory limit: 64 MB
Applying for a new job, programmer N. Smart required that his new salary (in rubles, positive integer) would be greater than his previous salary by integer percentage. What could be the highest possible number of previous jobs for mister Smart, if his latest salary did not exceed n rubles and his first salary was exactly s rubles?
Example. Let n = 10, s = 2, then m = 5. The sequence 2, 4 (+100%), 5 (+25%), 8 (+60%), 10 (+25%) is the longest (although not unique) sequence that satisfies to the problem statement. Salary increase percentage is written inside the brackets.
Problem illustration

Input

Two integers n and s separated by one or more spaces. 1 ≤ n, s ≤ 10000.

Output

A single integer m — the maximum number of N. Smart’s previous jobs.

Sample

inputoutput
10 2
5

Notes

if n = s, the answer is 1.
Problem Source: Quarterfinal, Central region of Russia, Rybinsk, October 17-18 2001
To submit the solution for this problem go to the Problem set: 1138. Integer Percentage