                    p[i][steps] += p[j][steps - 1] * (1.0 / W);
                }
            }
        }
        
        double answer = 0;
        for(int i = K; i <= N; ++i){
            for(int steps = 1; steps <= K; ++steps){
                answer += p[i][steps];
            }
        }
        
        return answer;
    }
};