#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define sz size() #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #define rep(i,a,b) for(int i=(a);i<(b);++i) #define clr(a, b) memset((a), (b) ,sizeof(a)) #define MOD 1000000007 unsigned int xor128(void) { static unsigned int x = 123456789; static unsigned int y = 362436069; static unsigned int z = 521288629; static unsigned int w = 88675123; unsigned int t; t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } int m[12][5] = { {0,1,2,3,4}, {5,6,7,8,9}, {10,11,12,13,14}, {15,16,17,18,19}, {20,21,22,23,24}, {0,5,10,15,20}, {1,6,11,16,21}, {2,7,12,17,22}, {3,8,13,18,23}, {4,9,14,19,24}, {0,6,12,18,24}, {4,8,12,16,20} }; int main(){ int n; cin>>n; int d[25]; int ans = 0; int ra[99]; rep(j,0,99)ra[j]=j; rep(i,0,1000000){ int nn = 99; rep(j,0,99){ swap(ra[xor128()%nn],ra[nn-1]); nn--; } clr(d,0); rep(j,0,n){ if(ra[j]<25)d[ra[j]]=1; } int p = 0; rep(j,0,12){ int c = 0; rep(k,0,5){ if(d[m[j][k]]==1){ c++; } } if(c==5)p++; } ans+=p; } printf("%.20f\n",1.*ans/1000000); return 0; } /* モンテカルロ法 */