Lang:G++
Edit12345678910111213141516171819202122232425262728293031// ybmj#include <bits/stdc++.h>using namespace std;typedef long long ll;const int INF = 0x3f3f3f3f;const int NINF = 0xc0c0c0c0;const int maxn = 105;double dp[maxn][605];int main() {/*#ifndef ONLINE_JUDGEfreopen("1.in","r",stdin);freopen("1.out","w",stdout);#endif*/std::ios::sync_with_stdio(false);int n, m;while (cin >> n >> m) {memset(dp, 0, sizeof(dp));for (int i = 1; i <= 6; i++) dp[1][i] = 1.0 / 6;for (int i = 2; i <= n; i++) {for (int t = 1; t <= 6; t++) {for (int k = 1; k + t <= m; k++) {dp[i][k + t] += dp[i - 1][k] * 1.0 / 6;}}}cout << fixed << setprecision(2) << dp[n][m] * 100 << endl;}