#include int p, c, j[10]; int main(void) { int n; scanf("%d%d", &p, &c); int a[6] = {2, 3, 5, 7, 11, 13}; int b[6] = {4, 6, 8, 9, 10, 12}; int i; double sum = 0; while(1) { double prod = 1; // intの最大 < (13*12)^5 なのでintには入らない for(i = 0; i < p ; i++) { prod *= a[ j[i] ]; } for(i = p; i < p + c; i++) { prod *= b[ j[i] ]; } sum += prod; i = 0; while(j[i] == 5) { j[i] = 0; i++; } if(i == p + c) { break; } j[i]++; } int q = 1; for(i = 0; i < p + c; i++) { q *= 6; } printf("%.9f\n", sum / q ); return 0; }