Description

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.

题意:一个人每年是*3的增长,一个人是每年*2的增长,问几年后可以超过

解法:模拟

 #include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
int i;
int a,b;
cin>>a>>b;
for(i=;a<=b;i++)
{
a*=;
b*=;
}
cout<<i-<<endl;
return ;
}

Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1) A的更多相关文章

  1. 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 ...

  2. Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1) C. Bear and Different Names 贪心

    C. Bear and Different Names 题目连接: http://codeforces.com/contest/791/problem/C Description In the arm ...

  3. Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1) B - Bear and Friendship Condition 水题

    B. Bear and Friendship Condition 题目连接: http://codeforces.com/contest/791/problem/B Description Bear ...

  4. 【树形dp】Codeforces Round #405 (rated, Div. 1, based on VK Cup 2017 Round 1) B. Bear and Tree Jumps

    我们要统计的答案是sigma([L/K]),L为路径的长度,中括号表示上取整. [L/K]化简一下就是(L+f(L,K))/K,f(L,K)表示长度为L的路径要想达到K的整数倍,还要加上多少. 于是, ...

  5. Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1)

    A 模拟 B 发现对于每个连通块,只有为完全图才成立,然后就dfs C 构造 想了20分钟才会,一开始想偏了,以为要利用相邻NO YES的关系再枚举,其实不难.. 考虑对于顺序枚举每一个NO/YES, ...

  6. 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 ...

  7. 【构造】Codeforces Round #405 (rated, Div. 1, based on VK Cup 2017 Round 1) A. Bear and Different Names

    如果某个位置i是Y,直接直到i+m-1为止填上新的数字. 如果是N,直接把a[i+m-1]填和a[i]相同即可,这样不影响其他段的答案. 当然如果前面没有过Y的话,都填上0就行了. #include& ...

  8. Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1) E

    Description Bear Limak prepares problems for a programming competition. Of course, it would be unpro ...

  9. Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1) D

    Description A tree is an undirected connected graph without cycles. The distance between two vertice ...

  10. Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1) C

    Description In the army, it isn't easy to form a group of soldiers that will be effective on the bat ...

随机推荐

  1. Canvas坐标轴中的Y轴距离是X轴的两倍

    如题,相信很多人在初次玩canvas的时候会出现这样的情况,跟着教程走的情况下,诶 怎么画出来的东西,不怎么对劲啊,,,ԾㅂԾ,,!!!!!先上代码 <!DOCTYPE html> < ...

  2. 【bzoj3620】似乎在梦中见过的样子

    枚举左端点,对于每个右端点处理出以右端点为结尾最大长度使得从左端点开始的前缀等于以右端点结束的后缀,即next数组 然后一直往前跳,直到长度小于子串长度的一半为止. #include<algor ...

  3. 关于hbase集群

    1 一个hadoop data node上运行一个region server region server和data node在同一台机器上,这样就保证了数据的局部性. 2 hbase region s ...

  4. oracle中去掉文本中的换行符、回车符、制表符

    一.特殊符号ascii定义 制表符 chr(9)  换行符 chr(10) 回车符 chr(13) UPDATE tc_car_order set USE_REASON =  REPLACE('USE ...

  5. gnss到底是什么呢

    GNSS Global Navigation Satellite System 全球卫星导航系统:提到这个很多人会不明白GNSS倒是是个啥东西呢,和北斗,GPS, GLONASS,Galileo系统有 ...

  6. 一个小bug,关于fuse_mount_sys

    在mount.c  中的 int fuse_mount_sys 函数中,如果注销掉 fd的open语句,此时fd一般为0. 然后,用普通用户运行ssfs且不加-f参数,一切显示正常 fuse_moun ...

  7. Java输入/输出(I/O)流的分类总结

    java.io中有四个重要的抽象类: InputStream(字节输入流) Reader(字符输入流) OutputStream(字节输出流) Writer(字符输出流) 其中,InputStream ...

  8. Gym - 100342J:Triatrip(Bitset加速求三元环的数量)

    题意:求有向图里面有多少个三元环. 思路:枚举起点A,遍历A可以到的B,然后求C的数量,C的数量位B可以到是地方X集合,和可以到A的地方Y集合的交集(X&Y). B点可以枚举,也可以遍历.(两 ...

  9. [SDOI2016] 模式字符串 (BZOJ4598 & VIJOS1995)

    首先直接点分+hash就可以做,每个点用hash判断是否为S重复若干次后的前缀或后缀,每个子树与之前的结果O(m)暴力合并.在子树大小<m时停止分治,则总复杂度为O(nlog(n/m)). 问题 ...

  10. 【旧文章搬运】Windows内核常见数据结构(线程相关)

    原文发表于百度空间,2008-7-24========================================================================== 线程是进程的 ...