小声BB

又开始更新了,最近打游戏王DL,这个栏目会留一些上分的心得。

题干

time limit per test:1 second
memory limit per test:256 megabytes
input:standard input
output:standard output

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倍,大的每年翻倍,问几年小的能超过大的

代码

#include<iostream>
using namespace std;int main()
{int a,b,n = 0;cin >> a >> b;while(a <= b){a *= 3;b *= 2;n++;}cout << n;return 0;
}

Codeforces——791A Bear and Big Brother相关推荐

  1. Codeforces A. Bear and Big Brother

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

  2. CF - 791A. Bear and Big Brother - 模拟

    1.题目描述: A. Bear and Big Brother time limit per test 1 second memory limit per test 256 megabytes inp ...

  3. Bear and Big Brother

    文章目录 一.Bear and Big Brother 总结 一.Bear and Big Brother 本题链接:Bear and Big Brother 题目: A. Bear and Big ...

  4. 【codeforces 791A】Bear and Big Brother

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

  5. Codeforces Bear and Big Brother

    题目链接 题目意思 现在有两头熊,分别为熊大,熊二.他们的体重分别为a,b,其中a<=b.熊大每年体重增加三倍,熊二每年体重增加两倍.现在问过几年熊大的体重比熊二重. 解题思路 这就是一道简单的 ...

  6. CodeForces 658C Bear and Forgotten Tree 3(构造)

    题意:构造一棵树,有N个点,直径为d,深度为h 思路:首先构造一个长度为d的链,然后把其中一个距离边上为h的点变为根.然后我们就不停的在距离根为h上面的那一点不停的加点就好了,使得新加入的点的距离也为 ...

  7. Codeforces A - Bear and Prime 100(交互题)

    A - Bear and Prime 100 思路:任何一个合数都可以写成2个以上质数的乘积.在2-100中,除了4,9,25,49外都可以写成两个以上不同质数的乘积. 所以打一个质数加这四个数的表: ...

  8. Codeforces 658D Bear and Polynomials【数学】

    题目链接: http://codeforces.com/contest/658/problem/D 题意: 给定合法多项式,改变一项的系数,使得P(2)=0,问有多少种方法? 分析: 暴力求和然后依次 ...

  9. codeforces 680A Bear and Five Cards

    点击打开链接 A. Bear and Five Cards time limit per test 2 seconds memory limit per test 256 megabytes inpu ...

最新文章

  1. 时间的玫瑰+但斌的投资思维
  2. php 检测是否是微信浏览器,php判断是否是微信浏览器和是否是移动端代码
  3. python保存变量_python – 在代码运行之间保存变量的数据
  4. windows 关闭端口被占用脚本
  5. 通过自定义ISAPI Filter来禁止敏感文件的访问
  6. 2021-04-21--中标麒麟--yum源修改
  7. Spring 由构造函数自动装配
  8. css打印适应纸张_从生态平衡到打印机故障分析
  9. c语言混响,混响也是大学问,c与数字混响的区别-文章-数字音视工程网DAV01.COM...
  10. SQLSERVER索引汇总
  11. 32muduo_net库源码分析(八)
  12. LINUX下载编译libreadline
  13. java网上书店模板_网上书店模板下载.doc
  14. 【Python实现视频转文字操作】
  15. 多进程中之文件描述符继承的消除
  16. linux应用层获取鼠标坐标
  17. 已知多边形各顶点坐标如何计算多边形面积
  18. 《基于移动互联的智慧健康社区系统的研发》 CSCD
  19. .NET c#音乐播放器
  20. 2022第二届中国ESG与可持续发展国际峰会将于11月17日-18日在上海举行

热门文章

  1. 【opencv】鱼眼图像畸变校正——透视变换
  2. Hibernate快速入门(2)
  3. L39.linux命令每日一练 -- 第六章 文件备份与压缩命令 -- scp和rsync
  4. elasticsearch安装和使用
  5. 程序员的修仙之路-筑基篇
  6. Bea Webblogic
  7. 启动weblogic提示BEA-000386错误,java.lang.NumberFormatException: null
  8. Koa洋葱圈模型源码浅析(`await next()`为什么能够形成洋葱圈模型?)
  9. php获取远程网页地址吗,php怎么获取远程网站上的图片的地址?有什么思路吗?...
  10. “天成云”品牌发布——Tungsten Fabric助力开源开放生态发展