Go: package main

import (
	"fmt"
	"math"
)

func main(){
	var n, m, k int
	for {
		fmt.Scan(&n, &m, &k)
		if n == 0 && m == 0 && k == 0{
			break
		}

		dp := make([][]int, n+1)
		for i:= 0; i < n+1; i++{
			dp[i] = make([]int, m*n + 1)
		}

		for i := 1; i <=m ; i++{
			dp[1][i] = 1
		}

		for i:= 1; i < n; i++{
			for j := 0; j <= i * m; j++{
				for k := 1; k <= m; k++{
					dp[i+1][j+k] += dp[i][j]
				}
			}
		}

		count := 0.0
		div := math.Pow(float64(m), float64(n))
		for i := 0; i <= n * m; i++{
			bill := 0.0
			if i <= k{
				bill = 1.0
			} else {
				bill = float64(i - k)
			}
			count += bill * float64(dp[n][i]) / div
		}
		fmt.Printf("%.010f\n", count)
	}
}

C++: #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

ll dp[100][100001];
ll n,m,k;
int main(){
    while(1) {
        cin >> n >> m >> k;

        if(n == 0) 
            break;

        REP(i,n + 1) {
            REP(j,n * m + 1) {
                dp[i][j] = 0;
            }
        }
        dp[0][0] = 1;

        FOR(i,1,n + 1) {
            REP(j,n * m + 1) {
                if(j > 0) {
                    dp[i][j] = dp[i][j - 1];
                }
                if(j - m - 1 >= 0) {
                    dp[i][j] -= dp[i - 1][j - m - 1];
                }
                if(j - 1 >= 0) {
                    dp[i][j] += dp[i - 1][j - 1];
                }
            }
        }

        double ans = 0;
        double d = 1;

        REP(i,n) {
            d *= (1.0 / m);
        }

        REP(i,n * m + 1) {
            ans += ((max(1ll,i - k) * dp[n][i] * 1.0) * d);
        }

        printf("%0.10f\n",ans);
    }
}

C++: #include <iostream>
#include <string>
#include <cctype>
#include <memory>
#include <vector>
#include <array>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <math.h>

//auto in = freopen("input", "r", stdin);

using namespace std;

struct Value{
	Value(long long v, long long count=1) : count(count), v(v){};
	int count;
	long long v;
};

int main(){
	cout << setprecision(20);
	while(true){
		long long n, m, k, sum = 0;
		cin >> n >> m >> k;
		if(n==0 && m==0 && k==0) break;
		stack<Value> s;
		
		s.push(Value(0,0));

		while(!s.empty()){
			auto v = s.top(); s.pop();
			if(v.count==n){
				sum += v.v-k>0 ? v.v-k : 1;
				continue;
			}
			for(int i=1; i<=m; ++i){
				auto nv = v.v + i;
				s.push(Value(nv, v.count+1));
			}
		}
		cout << sum/pow((long double)m,n) << endl;
	}
}

C++: 
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1286

#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<numeric>
#include <iomanip>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;

using namespace std;

int N,M,K;

int dfs(int n, int total)
{
	int res=0;
	if(n == 0){
		return ( (total - K) > 0 ) ? total - K : 1;
	}
	else{
		REP( i, 1, M+1 ){
			res += dfs( n-1, total+i );
		}
	}
	return res;
}

int main()
{
	cout << setprecision(8) << fixed;

	while(cin >> N >> M >> K && N)
	{
		double d = pow(M,N);
		cout << dfs(N,0) / d << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double EPS = 1e-9;
typedef pair<int, int> P;
typedef unsigned int ui;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
int main() {
	int n, m, k;
	while (cin >> n >> m >> k, n) {
		if (n > 1) {
			double r = 1; double out = 0;
			rep(i, n) {
				r *= m;
			}
			ll cnt = 0; int dp[1000] = {};
			dp[0] = 1;
			rep(i, n) {
				for (int j = 999; j >= 0; j--) {
					rep1(k, m) {
						if (j + k < 1000) {
							dp[j + k] += dp[j];
						}
					}
					dp[j] = 0;
				}
			}
			rep(i, 1000) {
				int x = i - k;
				if (x <= 0)x = 1;
				out += ((ll)dp[i] * (ll)x)/r;
			}
			cout << fixed << setprecision(8) << out << endl;
		}
		else {
			double out = 0;
			rep1(i, m) {
				int x = i - k;
				if (x <= 0)x = 1;
				out += x/(double)m;
			}
			cout << fixed << setprecision(8) << out << endl;
		}
	}
	return 0;
}

C++: #include<stdio.h>
#include<algorithm>
#include<math.h>
int m,k;
double F(int n,int sum)
{
	if(!n)return std::max(sum-k,1);
	double r=0;
	for(int i=1;i<=m;++i)
		r+=F(n-1,sum+i);
	return r;
}
int main()
{
	int n;
	while(scanf("%d%d%d",&n,&m,&k),n)
	{
		double x=pow(double(m),n);
		printf("%.8f\n",F(n,0)/x);
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back
template<typename T>inline bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>inline bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

void init();
void last();

void init() {

}

void solve(int n, int m, int k) {
    vector<long long> dp(n * m + 10);
    dp[0] = 1;
    for (int i = 0; i < n; i++) {
        vector<long long> newdp(n * m + 10);
        for (int j = 0; j < n * m - m + 1; j++) {
            for (int dice = 1; dice <= m; dice++) {
                newdp[j + dice] += dp[j];
            }
        }
        dp = newdp;
    }
    double sum = 0;
    for (int i = 0; i < n * m + 10; i++) {
        LL inc = 0;
        if (i - k <= 0) inc = 1;
        else inc = i - k;
        sum += inc * dp[i];
    }
    printf("%.10lf\n", sum / pow(m, n));
}

void last() {
    exit(0);
}

int main(void) {
	int a, b, c, x, y, z, n, m, p, k;
	string s;
	while (cin >> n >> m >> k, n) {
		solve(n, m, k);
		//break;
	}
    last();
}