#include<bits/stdc++.h>
using namespace std;
#define M1 1000000007
#define M2 998244353
#define ll long long int
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define F first
#define S second
#define PB push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define V(a) vector<a>
#define endl '\n'
#define test(t) while(t--)
#define PI acos(-1.0)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repp(i,b,a) for(ll i=b-1;i>=a;i--)
#define clr(ar, val) memset(ar, val, sizeof(ar))
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define ps(y) fixed << setprecision(y)
#define all(x) begin(x),end(x)
#define allr(x) rbegin(x),rend(x)
const int inf= 0x3f3f3f3f ;
const ll INF= 0x3f3f3f3f3f3f3f3f ;
const int dx[ 4 ] = { 0 , - 1 , 0 , 1 } ;
const int dy[ 4 ] = { - 1 , 0 , 1 , 0 } ;
class EmptyTheBox{
public :
double Calculate( long long int subset) {
double t = 1 ,sum= 0 ;
while ( subset > 0 ) {
if ( subset& 1 ) sum + = t;
subset >>= 1 ;
t++ ;
}
return sum;
}
double minExpectedPenalty( int D, int T) {
double * rollprob = new double [ 2 * D+ 1 ] ( ) ;
for ( int i = 1 ; i<= D; ++ i) {
for ( int j = 1 ; j<= D; ++ j) {
rollprob[ i+ j] + = 1 ./ ( D* D) ;
}
}
int excess = 0 ;
while ( T > 2 * D) excess+ = T,T-- ;
T = min( 2 * D,T) ;
double * dp = new double [ 1 << T] ( ) ;
for ( long long int subset = 0 ; subset< ( 1 << T) ; ++ subset) {
for ( int roll = 2 ; roll <= 2 * D; ++ roll) {
double X = Calculate( subset) ;
for ( long long int reduceset = 1 ; reduceset < ( 1 << T) ; ++ reduceset) {
if ( ( ( subset& reduceset) == reduceset) && ( Calculate( reduceset) == roll) ) {
X = min( X,dp[ subset^ reduceset] ) ;
}
}
dp[ subset] + = rollprob[ roll] * X;
}
}
return ( dp[ ( 1 << T) - 1 ] + excess) ;
}
} ;
// int main(){
// int d,t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xsKXsKICAgICAgICAgICAgICAgIGRvdWJsZSBYID0gQ2FsY3VsYXRlKHN1YnNldCk7CiAgICAgICAgICAgICAgICBmb3IobG9uZyBsb25nIGludCByZWR1Y2VzZXQgPSAxO3JlZHVjZXNldCA8ICgxPDxUKTsrK3JlZHVjZXNldCl7CiAgICAgICAgICAgICAgICAgICAgaWYgKCgoc3Vic2V0JnJlZHVjZXNldCkgPT0gcmVkdWNlc2V0KSAmJiAoQ2FsY3VsYXRlKHJlZHVjZXNldCkgPT0gcm9sbCkpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgWCA9IG1pbihYLGRwW3N1YnNldF5yZWR1Y2VzZXRdKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBkcFtzdWJzZXRdICs9IHJvbGxwcm9iW3JvbGxdKlg7CiAgICAgICAgICAgIH0gCiAgICAgICAgfQogICAgICAgIHJldHVybiAoZHBbKDE8PFQpLTFdICsgZXhjZXNzKTsKCX0JCn07CgovLyBpbnQgbWFpbigpewovLyAgICAgaW50IGQsdDsKLy8gICAgIGNpbiA+PiBkID4+IHQ7Ci8vICAgICBFbXB0eVRoZUJveCBlbXBieDsKLy8gICAgIGNvdXQgPDwgZW1wYngubWluRXhwZWN0ZWRQZW5hbHR5KGQsdCkgPDwgZW5kbDsKLy8gfQoKCg==