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++

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt