Two little greedy bears have found two pieces of cheese in the forest of weight a and b grams, correspondingly. The bears are so greedy that they are ready to fight for the larger piece. That's where the fox comes in and starts the dialog:
two little greedy bears have found two pieces of cheese in the forest of weight a and b grams, correspondingly. the bears are so greedy that they are ready to fight for the larger piece. that's where the fox comes in and starts the dialog: "little bears, wait a little, i want to make your pieces equal" "come off it fox, how are you going to do that?", the curious bears asked. "it's easy", said the fox. "if the mass of a certain piece is divisible by two, then i can eat exactly a half of the piece. if the mass of a certain piece is divisible by three, then i can eat exactly two-thirds, and if the mass is divisible by five, then i can eat four-fifths. i'll eat a little here and there and make the pieces equal".
The little bears realize that the fox's proposal contains a catch. But at the same time they realize that they can not make the two pieces equal themselves. So they agreed to her proposal, but on one condition: the fox should make the pieces equal as quickly as possible. Find the minimum number of operations the fox needs to make pieces equal.










