Mock CCC '18 Contest 1 J3/S1 - A Math Problem

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 5.0s
Memory limit: 1G

Problem type

Given positive integers K, P, and X, compute the minimum possible value of f(M) = MX + \dfrac{KP}{M} given that M must be a positive integer.


1 \le K, P, X \le 10000

Input Specification

The input consists of a single line containing three space-separated integers K, P, and X.

Output Specification

Print, on a single line, the minimum possible value of f subject to the above constraint, rounded to exactly three decimal places.

The input data will be set such that the correct answer will not be within 10^{-5} of the aforementioned rounding boundary.

Sample Input

31 41 59

Sample Output


Sample Input

3 4 5

Sample Output



  • 0
    xjhlg123555  commented on Oct. 13, 2018, 8:41 p.m.

    How come derivative is not accurate enough?