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?

Input

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.

Output

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

Examples
input
4 7
output
2
input
4 9
output
3
input
1 1
output
1
Note

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.

题解:水很深

 #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
const int N=;
const int mod=1e9+;
int main()
{
std::ios::sync_with_stdio(false);
int a,b,i=;
cin>>a>>b;
while(a<=b){
a*=;
b*=;
i++;
}
cout<<i<<endl;
return ;
}

Codeforce 791A - Bear and Big Brother的更多相关文章

  1. Codeforces 791A Bear and Big Brother(暴力枚举,模拟)

    A. Bear and Big Brother time limit per test:1 second memory limit per test:256 megabytes input:stand ...

  2. Codeforces791A Bear and Big Brother

    A. Bear and Big Brother time limit per test 1 second memory limit per test 256 megabytes input stand ...

  3. Codeforces A. Bear and Big Brother

    ...不行.这题之后.不做1000分以下的了.很耻辱   A. Bear and Big Brother time limit per test 1 second memory limit per t ...

  4. 【codeforces 791A】Bear and Big Brother

    [题目链接]:http://codeforces.com/contest/791/problem/A [题意] 给你两个数字a和b; a每次乘3,b每次乘2 问你什么时候a第一次大于b [题解] 傻逼 ...

  5. Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1)A B C 水 并查集 思路

    A. Bear and Big Brother time limit per test 1 second memory limit per test 256 megabytes input stand ...

  6. 【Codeforces Round #405 ( Div 2)】题解

    Bear and Big Brother 签到题,直接模拟就可以了. Bear and Friendship Condition 满足只能是每个朋友圈中每个人和其他人都是朋友,这样的边数的确定的. 然 ...

  7. Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1) 菜鸡只会ABC!

    Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1) 全场题解 菜鸡只会A+B+C,呈上题解: A. Bear and ...

  8. codeforce好地方啊 Bear and Elections *

    Codeforces Round #318 居然可以看测试数据,哪里没过一目了然,哈哈哈 #include<cstdio> #include<iostream> #includ ...

  9. CodeForces 574D Bear and Blocks

    Limak is a little bear who loves to play. Today he is playing by destroying block towers. He built n ...

随机推荐

  1. sql语句优化(一)

    1.查看执行时间和cpu占用时间 set statistics time on select * from dbo.Product set statistics time off 2.查看查询对I/0 ...

  2. dedecms怎样调用指定id文章?

    前面我们聊了帝国cms如何调用指定id的文章到首页,作为同行的织梦cms应该也是可以实现的吧?那么,dedecms怎样调用指定id文章呢?使用idlist直接调用指定的ID这样的方法是比较好的.官方给 ...

  3. linux命令学习:PATH and LDFLAGS and CFLAGS

    CFLAGS 表示用于 C 编译器的选项, CXXFLAGS 表示用于 C++ 编译器的选项. 这两个变量实际上涵盖了编译和汇编两个步骤.     先来看几个相关的环境变量:PATH.LDFLAGS. ...

  4. 20170720 Celery 异步任务处理到Sql Server 发生死锁

    -- 1.  异常提示情况如下: 需要解决为什么引起死锁 -- 叹气 原因: 在使用Celery 启用了 配置参数 CELERYD_CONCURRENCY = 10  表示开了10块线程池. 有好处, ...

  5. 配置AlwaysON出错

    在其中一个集群节点的SQL Server中验证各节点的投票数 ,在其中一个集群节点的SQL Server上执行使用下面SQL语句 SELECT * FROM sys.dm_hadr_cluster_m ...

  6. 爆破root密码hash John the Ripper和hydra爆破ssh密码

    官方网站:http://www.openwall.com/john/ 下载:wget http://www.openwall.com/john/j/john-1.8.0.tar.gz 解压:tar - ...

  7. Linux和windows 查看程序、进程的依赖库的方法

    Linux: 1. 利用ldd查看可执行程序的依赖库   [root@~]# ldd /usr/local/php/bin/php   linux-vdso.so.1 => (0x00007ff ...

  8. android 通过页面上关键字快速定位代码

    这里定位微信关于页面, 当然可以直接获取当前最顶层activity 反编译apk后 搜索 strings.xml,找到对应id 搜索文件到用到id对应的成员变量,通常 是在R*.smali文件中 字符 ...

  9. cocos2d-x JS 加载播放Studio帧动画的两种方法

    昨天懵逼的搞了两个多小时(百度无果/没看出什么矛头),自己琢磨总算搞出来了   1.  var levelUpJson = ccs.load("res/LevelUp.json") ...

  10. mybatis3 date 的处理

    <if test="startTime!=null and startTime!=''"> <![CDATA[ and DATE_FORMAT(create_ti ...