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

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

some-alt