123456
int n; std::cin >> n; double sum = 0; for (int i = 1; i <= n; ++i) sum += i; double result = 2 * n / sum;