PROGRAM ForExample(Input, Output);
    { Program 4.5 - Compute the Nth partial sum of the
        harmonic series H(N) = 1 + 1/2 + 1/3 + ... + 1/N
        using a for statement for iteration. }

    VAR
        I, N: Integer;
        H: Real;
BEGIN
    Read(Input, N);
    Write(Output, N);

    H := 0;
    FOR I := N DOWNTO 1 DO
        H := H + 1/I;
    WriteLn(Output, H);
END.
