Division of Candies#8290

Division of Candies

ثانية
64 ميغابايت
متوسط

Two brothers, Misha and Pasha, bought some candies at the store. On their way home, the bag tore, and they ended up putting the candies in their pockets. Once home, they decided to split the candies equally. Misha had candies, and Pasha had candies. However, they chose a unique method to divide them. The brother with more candies would double the number of candies the other brother had, using his own candies to do so. They repeated this process until both had the same number of candies. Can they achieve an equal distribution, and if so, how many operations will it take?

المدخلات

Two integers and , where a + b < 2 \cdot 10^9.

المخرجات

Print the number of operations required. If it's impossible to equalize the candies, print .

أمثلة

مثال 1

Loading
Loading