。。。不行。这题之后、不做1000分以下的了。很耻辱
A. Bear and Big Brother
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

Copy

4 7

output

Copy

2

input

Copy

4 9

output

Copy

3

input

Copy

1 1

output

Copy

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>
using namespace std;
int main(){int a;int b;cin>>a;cin>>b;int res = 0;do{res++;a*=3;b*=2;}while(a<=b);cout<<res;return 0;
}

转载于:https://www.cnblogs.com/godoforange/p/10944674.html

Codeforces A. Bear and Big Brother相关推荐

  1. Codeforces——791A Bear and Big Brother

    小声BB 又开始更新了,最近打游戏王DL,这个栏目会留一些上分的心得. 题干 time limit per test:1 second memory limit per test:256 megaby ...

  2. Bear and Big Brother

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

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

  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. 清华姚班/智班2020级新生来了!中国奥数新晋“一姐”在列,湖南、湖北人数最多...
  2. Android init.rc文件解析过程详解(三)
  3. 如何实现一套可切换的声网+阿里的直播引擎
  4. 如何防止单例模式被JAVA反射攻击
  5. 安卓手机与PC不得不说的那些事 之 篇一 网络分享
  6. spark学习-SparkSQL-java版JavaRDD与JavaPairRDD的互相转换
  7. 通信系统中语音信号的仿真分析
  8. php 传真机 原理,三洋SFX-11B传真机简单拆解
  9. Unity Shader学习(四)试着绘制一个正方形
  10. LaTex便捷插入罗马数字
  11. java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation问题解决
  12. 团队的英文翻译缩写_有感情的一起游戏的团队英文缩写
  13. 邝子平:vc兼做pe?
  14. web前端人员每天必须关注的前端社区网站
  15. 计算机电子电路原理图,简易电子琴设计电路图大全(八款模拟电路设计原理图详解) - 消费类电子电路图...
  16. 2023最新彩虹易支付源码免授权2.0版前台模板美化/用户中心美化
  17. 苹果+android+扫码支付,苹果iOS12捷径扫码付款怎么设置 微信支付宝扫码二合一支付捷径...
  18. C++ 几个特殊符号
  19. 导入 txt 文件数据到 MySQL 表
  20. 公有iot私有iot架构_玩洋葱Omega IoT设备在OLED屏幕上显示实时血糖

热门文章

  1. 家族关系查询系统(2021-9-22更新)
  2. IDM下载器的安装与使用
  3. Spring Boot入门教程(四十六): @Async
  4. Keil5_C51安装
  5. 如何用大数据进行宠物店选址要素分析
  6. 【计算机网络】期末复习试题
  7. sql语句之存储过程,触发器,函数,事务,游标
  8. XSL中特殊符号详解
  9. FWFT FIFO的读写操作
  10. 《设计模式》12.组合模式(结构型)