Farmer John is playing math game with cows. To help his cows learning addition and multiplication, he invented a new game. In the beginning, he would provide two number a and b. After that, cows would report two number each turn. At the turn i, i*a and i*b should be reported. Once there exists an integer in the segment [i*a, i*b], the game ends. Now, John wants to know after how many turns the game would end. So, he ask for your help.
Farmer John is playing math game with cows. To help his cows learning addition and multiplication, he invented a new game. In the beginning, he would provide two number a and b. After that, cows would report two number each turn. At the turn i, i*a and i*b should be reported. Once there exists an integer in the segment [i*a, i*b], the game ends. Now, John wants to know after how many turns the game would end. So, he ask for your help.
(图片来源网络,侵删)