#include using namespace std; int p; int q; long double dp[2][102]; vector v; int main(){ cin >> p >> q; double ans = 1.0 / 3.0; dp[0][p] = 1.0 / 3.0; int siz = v.size(); bool flag = false; double star = clock(); while((clock()-star)/(double)(CLOCKS_PER_SEC)<1.8){ for (int j = 0; j <=100; j++){ if (1){ //win long double P = j; P /= 100.0; ans += dp[flag][j] * P*1.0 / 2.0; //tie int nex_j = max(j-q,0); dp[flag^true][nex_j] += dp[flag][j] * P*1.0 / 2.0; //nothing P = (1.0 - P); ans += dp[flag][j] * P*1.0 / 3.0; nex_j = min(j + q,100); dp[flag^true][nex_j] += dp[flag][j] * P*1.0 / 3.0; } dp[flag][j] = 0; } flag ^= true; } printf("%.16f\n", ans); return 0; }