#include<iostream>
using namespace std;
int main()
{
double x;
int n;
cout.precision(2);
while(cin>>n&&n!=0)
{
x=n;
for(int i=2;i<=n;i++)
x+=1.0/i*2*(n+1-i);
cout<<fixed<<x<<endl;
}
return 0;
}
Saturday, 21 March 2009
HOJ ( acm.hdu.edu.cn ) 2156
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment