Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.

book
The Bear Growth Race

Bear Bill wants to become the largest of bears, or at least to become larger than his brother Bob. Right now, Bill and Bob weigh a and b respectively. It's guaranteed that Bill's weight is smaller than or equal to his brother's weight. Bill eats a lot and his weight is tripled after every year, while Bob's weight is doubled after every year. After how many full years will Bill become strictly heavier than Bob?

Example 1

Input:

a = 4; b = 7

Output:

2
main.cpp

main.cpp

C++

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

some-alt