Big Deposits

View as PDF

Submit solution

Points: 7 (partial)
Time limit: 0.6s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Kazuma is depositing money! Every year, Kazuma puts N coins into his bank account. At the end of each year, Kazuma's investments will grow by P percent, rounded down to the nearest coin. After Y years, he would like to have at least T coins in his bank account so that he can buy some presents for a special someone. Since Kazuma is an efficient individual, he would like to know the minimum number of coins he has to put into his bank account every year so that he will have T coins by the end of Y years. Can you help him find this value?

Input Specification

The first and only line will contain 3 space separated integers P, Y, and T.

Output Specification

The output should contain a single integer, the minimum number of coins N that Kazuma should put into his bank account per year.


For all cases,

1 \le P \le 100

1 \le Y \le 10^6

1 \le T \le 10^{16}

Subtask 1 [20%]

1 \le Y \le 10^3

1 \le T \le 10^6

Subtask 2 [80%]

No additional constraints.

Sample Input 1

50 3 200

Sample Output 1


Explanation for Sample Output 1

Initially, Kazuma's bank account is empty. In the first year, Kazuma deposits 29 coins into the bank, which at the end of the year turns into 43 coins (rounding down). In the second year he again deposits 29 coins, reaching a total of 72 coins. At the end of the year, the interest boosts this up to 108 coins. In the third year, the balance is 137 coins after Kazuma's deposit, increasing to 205 coins after interest.

Sample Input 2

100 2 300

Sample Output 2


Explanation for Sample Output 2

Here is Kazuma's bank balance over the course of 2 years: 50\rightarrow100\rightarrow150\rightarrow300

Sample Input 3

80 2 4

Sample Output 3


Explanation for Sample Output 3

Due to the interest being rounded down to the nearest coin, only depositing 1 coin per year would not be enough.

Sample Input 4

You do not have to pass this sample case in order to pass subtask 1.

11 63524 9182748294

Sample Output 4



  • 0
    3fecta  commented on Sept. 29, 2020, 12:15 p.m.

    Kazumin is a 4fecta alt :monkey:

  • 1
    Dan13llljws  commented on Dec. 27, 2019, 1:25 a.m.

    Kazuma can live for 10^6 years

    • 6
      4fecta  commented on Dec. 27, 2019, 8:45 p.m.

      What present is he getting that costs ten quadrillion Eris???

      • 7
        ArtyKing12  commented on Sept. 28, 2020, 8:39 p.m.

        He lives in Zimbabwe