#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; double m, n; double sum = 0; int func(double mm, int nn) { if (nn == 0) { // //cout << "mm->" << mm << endl; sum += mm; return 0; } func(mm * 2, nn - 1); func(mm + 1, nn - 1); func(0, nn - 1); return 0; } int main() { int i, j, k; cin >> m >> n; double ont = 1.0 / 3.0; double num = 0; if (m == 0) { for (i = 0; i < n; i++) { num += ont; } cout << fixed << setprecision(10) << num << endl; } else { for (i = 0; i < n; i++) { m += ont; } cout << fixed << setprecision(10) << m << endl; } /* double num2 = 0; for (i = 0; i < 10; i++) { func(m, (int)n + i); double num = pow(3, n + i); cout << "i->" << i << " " << fixed << setprecision(10) << sum / num << endl; cout << "num-num2 " << (sum / num) - num2 << endl << endl; num2 = sum / num; sum = 0; }*/ getchar(); getchar(); return 0; }