#include using namespace std; int gcd(int a, int b) { while (b != 0) { int temp = b; b = a % b; a = temp; } return a; } double fill_dp(int N,vector dp){ // N番目をうめる if(dp[N] >= 0){ return dp[N]; } if(N == 1){ dp[1] = 0.0; return dp[1]; } double sum_e = 0.0; for(int k=1;k> N; vector dp(N+1,-1); cout << fill_dp(N,dp) << endl; }