// AOJ 0504
#include<cstdio>
#include<vector>
#define rep(i,a) for(int i=0;i<(a);++i)
#define repd(i,a) for(int i=(a);i>=0;--i)

typedef std::vector<int> dec;

int n, k, m, r;

dec add( const dec &a, const dec &b )
{
	dec ret( 10006 );

	int c = 0;
	repd( i, 10005 )
	{
		int t = a[i]+b[i]+c;
	
		ret[i] += t%10;
		c = t/10;
	}

	return ret;
}

dec recip( int n )
{
	dec ret( 10006 );

	int c = 1;
	rep( i, ret.size() )
	{
		ret[i] = c/n;
		c %= n; c *= 10;
	}

	return ret;
}

int main()
{
	while( scanf( "%d%d%d%d", &n, &k, &m, &r ), n|k|m|r )
	{
		dec ans( 10006 );
		ans = recip( n );
		if( m ) rep( i, n-1 )
			ans = add( ans, recip( n*(i+1) ) );
		
		rep( i, r+1 )
		{
			printf( "%d", ans[i] );
			
			if( !i )
				putchar('.');
		}
		puts("");
	}

	return 0;
}