HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


50235 - How Many Years

Section problems

• 50226 - Convert Celsius to Fahrenheit
• 50227 - Smallest Number
• 50228 - Even Numbers
• 50229 - Print All Numbers
• 50230 - ASCII Codes
• 50231 - Hours Minutes and Seconds
• 50233 - Prime Number
• 50234 - Draw the Pattern
• 50235 - How Many Years
• 50236 - Put the Numbers in Descend...
• 50237 - Sum of Cubes-1
• 50238 - Translate Score into Grade
• 50240 - Print All Prime Numbers
• 50241 - Convert KPH to MPH
• 50242 - Second Largest
• 50244 - Manhattan Distance
• 50250 - Shifting rows and columns

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Halil Karimis.

After how many years?

A man invests $A and $B to two different companies. A grows 3% per year. B grows 2% per year.

Write a program to find after how many years A will surpass B.

Input: You will be given 2 positive integers (M and N) and M < N.

Output : Show one integer: the number of years that A will be more than B.

Sample Input1:

Sample Input2:

500 700

1000 2000

Sample  Output1:

Sample  Output2:

35

72

 

Для отправки решений необходимо выполнить вход.

www.contester.ru