Sum of fractions

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

Input

Input consists of several triples of natural numbers a, b and k, such
that 1 ≤ a ≤ b and k ≥ 1.

Output

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

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:52:16.876Z

© Jutge.org, 2006–2026.
https://jutge.org
