子序列的和


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

有一个序列,要求它的其中一段的和: 1,1/2,1/3, 1/4, …,1/n 求子序列的和,又要精确到小数点后几位,手工算的话,真是繁,作为编程大赛中,活活血,热热身,倒是不错。

Input

输入中有一些整数对a,b(1<=a<=b<=10000),如果a,b都为0,则计算结束。

Output

计算1/a + 1/(a+1) + … + 1/b的和。精确到小数6位,显然其结果需要四舍五入。每个结果占一行。

Sample

Input

1 3
0 0

Output

1.833333

Comments

There are no comments at the moment.