#include using namespace std; const int N = 110; double a[N], c[N]; int main() { a[1] = 2; c[1] = 1; a[2] = 3; c[2] = 2; double s = a[1] / c[1] + a[2] / c[2]; for (int i = 3; i <= 20; i++) { a[i] = a[i - 1] + a[i - 2]; c[i] = c[i - 1] + c[i - 2]; s += a[i] / c[i]; } cout << s << endl; return 0; }