Sum of fractions P76024


Statement
 

pdf   zip

Write a program that reads triples of natural numbers aa, bb and kk, and for each one computes and prints the result of 1a+1a+k+1a+2k+\frac{1}{a} + \frac{1}{a+k} + \frac{1}{a+2k} + \dots for all fractions with denominator smaller than or equal to bb.

Input

Input consists of several triples of natural numbers aa, bb and kk, such that 1ab1 \le a\le b and k1k \ge 1.

Output

For each triple, print in a line the result of the sum with four digits after the decimal point.

Public test cases
  • Input

    1 3 1
    5 5 2
    5 6 2
    5 7 2
    

    Output

    1.8333
    0.2000
    0.2000
    0.3429
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Python
    User solutions
    C C++ Java Python