HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


50899 - How Many Years

Guest
• Review clarifications (3)

Volume problems

• 50897 - Prime Number
• 50901 - Sum of Cubes-1
• 50957 - Divisible by 3
• 51115 - Pascal Triangle
• 50898 - Draw the Pattern
• 51116 - The Star Triangle
• 50896 - Sum of Even Numbers
• 50815 - Breaking the Bunker
• 50899 - How Many Years
• 50806 - TVSH
• 51078 - Max trade
• 50820 - Post Office
• 50807 - Euro to Leke
• 50810 - Print Office
• 50952 - Derby Tirana
• 50871 - Harmonic Mean
• 50859 - Low performance

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