Memory and De-Evolution

题意翻译

Memory 对物体,尤其是三角形的变化感兴趣。 他有一个边长为 $x$ 的等边三角形,他希望通过一些操作获得一个边长为 $y$ 的等边三角形。 他一次可以修改当前三角形一边的长度,修改后也应为合法的三角形。每次修改后,每一边的长度都应该是整数。 Memory 要获得边长 $y$ 的等边三角形,所需的最小修改次数是多少? 输入格式: 第一行包含两个整数 $x$ 和 $y$($3\le y < x \le 100000$),分别为最开始的三角形边长与想要获得的三角形边长。 输出格式: 输出一个整数,即为最小的修改次数。

题目描述

Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length $ x $ , and he wishes to perform operations to obtain an equilateral triangle of side length $ y $ . In a single second, he can modify the length of a single side of the current triangle such that it remains a non-degenerate triangle (triangle of positive area). At any moment of time, the length of each side should be integer. What is the minimum number of seconds required for Memory to obtain the equilateral triangle of side length $ y $ ?

输入输出格式

输入格式


The first and only line contains two integers $ x $ and $ y $ ( $ 3<=y&lt;x<=100000 $ ) — the starting and ending equilateral triangle side lengths respectively.

输出格式


Print a single integer — the minimum number of seconds required for Memory to obtain the equilateral triangle of side length $ y $ if he starts with the equilateral triangle of side length $ x $ .

输入输出样例

输入样例 #1

6 3

输出样例 #1

4

输入样例 #2

8 5

输出样例 #2

3

输入样例 #3

22 4

输出样例 #3

6

说明

In the first sample test, Memory starts with an equilateral triangle of side length $ 6 $ and wants one of side length $ 3 $ . Denote a triangle with sides $ a $ , $ b $ , and $ c $ as $ (a,b,c) $ . Then, Memory can do ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF712C/02dc9f273b062fc08e50f56d157590c1a8704a6d.png). In the second sample test, Memory can do ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF712C/d3fd12d8941be4a8d2b20f8d1979e4399cf5d0bd.png). In the third sample test, Memory can do: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF712C/00332e5e5c2d4d98f0334748682d4c694d544864.png) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF712C/1e2ecb82dc99142c860992dd686893771d9fd7dd.png).