小声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. 提交调用验证_干货丨RPA验证码识别技巧
  2. python编程入门教学下载-Python编程从入门到实践的PDF教程免费下载
  3. H5学习从0到1-H5的基本标签(2)
  4. 说实话,这个发布会绝了!
  5. 7.JasperReports学习笔记7-applet打印
  6. eclipse图标含义
  7. Leetcode 456.132模式
  8. 如何关闭flashhelper的ff新推荐广告弹窗
  9. qgis打开shp数据_关于QGIS打开SHP文件属性表乱码
  10. C1能力认证训练题解析 _ 第一部分 _ 计算机通识
  11. 【积累小技巧】word格式刷没作用
  12. 从浏览器中打开我们的应用
  13. sht30 linux示例代码,STM32------SHT30温湿传感器(示例代码)
  14. fflush(stdout)作用
  15. 解决:RuntimeError: Expected object of scalar type Int but got scalar type Double
  16. 推荐一个好用的OKR工具
  17. C语言写mempocy
  18. oracle分区表优点
  19. python爬虫-电影数据抓取
  20. 触类旁通Elasticsearch:关联

热门文章

  1. Python 中有 3 个不可思议的返回功能
  2. NFC framework introduce
  3. 5分钟学会cleos注册EOS主网账户、投票和发币
  4. kali linux开机黑屏只有鼠标可以移动
  5. python中的socketserver模块与多线程
  6. APT30-网络间谍活动分析
  7. Element-UI实现对话框内播放视频
  8. 《机器学习》读书笔记,第二章概念学习和一般到特殊序
  9. 反恐精英java_使用java查询反恐精英1.6服务器信息
  10. Django 基于类的通用视图详解