CF791A.Bear and Big Brother

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Bear Limak wants to become the largest of bears, or at least to become larger than his brother Bob.

Right now, Limak and Bob weigh a and b respectively. It's guaranteed that Limak's weight is smaller than or equal to his brother's weight.

Limak 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 Limak become strictly larger (strictly heavier) than Bob?

熊 Limak 想成为最大的熊,或者至少要比他的兄弟 Bob 更重。

目前,Limak 和 Bob 的体重分别为 aa 和 bb。已知 Limak 的体重小于或等于他兄弟的体重。

Limak 食量很大,每年他的体重变为原来的三倍;而 Bob 每年的体重变为原来的两倍。

经过多少个完整的年份后,Limak 的体重将严格大于(即严格更重)Bob 的体重?

输入格式

The only line of the input contains two integers a and b (1 ≤ a ≤ b ≤ 10) — the weight of Limak and the weight of Bob respectively.

输入仅包含一行,其中有两个整数 aa 和 bb(1 ≤ a ≤ b ≤ 101 ≤ a ≤ b ≤ 10),分别表示 Limak 和 Bob 的体重。

输出格式

Print one integer, denoting the integer number of years after which Limak will become strictly larger than Bob.

输出一个整数,表示 Limak 的体重严格超过 Bob 所需的年数。

输入输出样例

  • 输入#1

    4 7

    输出#1

    2
  • 输入#2

    4 9

    输出#2

    3
  • 输入#3

    1 1

    输出#3

    1

说明/提示

In the first sample, Limak weighs 4 and Bob weighs 7 initially. After one year their weights are 4·3 = 12 and 7·2 = 14 respectively (one weight is tripled while the other one is doubled). Limak isn't larger than Bob yet. After the second year weights are 36 and 28, so the first weight is greater than the second one. Limak became larger than Bob after two years so you should print 2.

In the second sample, Limak's and Bob's weights in next years are: 12 and 18, then 36 and 36, and finally 108 and 72 (after three years). The answer is 3. Remember that Limak wants to be larger than Bob and he won't be satisfied with equal weights.

In the third sample, Limak becomes larger than Bob after the first year. Their weights will be 3 and 2 then.

在第一个样例中,Limak 初始体重为 4,Bob 初始体重为 7。一年后,他们的体重分别为 4⋅3=124 \cdot 3 = 12 和 7⋅2=147 \cdot 2 = 14(其中一个体重变为三倍,另一个变为两倍)。此时 Limak 的体重仍不大于 Bob。两年后,他们的体重分别为 3636 和 2828,因此前者大于后者。Limak 在两年后首次超过 Bob,故应输出 2。

在第二个样例中,Limak 和 Bob 在随后几年的体重依次为:1212 和 1818,接着是 3636 和 3636,最后是 108108 和 7272(三年后)。答案为 3。请注意,Limak 希望体重严格大于 Bob,相等的情况不能满足他的要求。

在第三个样例中,Limak 在第一年后即超过 Bob,此时他们的体重分别为 33 和 22。

输入解题思路,AI测评打分。不知道怎么写?

首页