fork(3) download
  1. #include <cstdio>
  2.  
  3. int main() {
  4. long long n;
  5. scanf("%lld", &n);
  6. double res = (1.0 - 1.0 / (n * (n + 1) + 1)) / 2;
  7. printf("%.5lf\n", res);
  8. return 0;
  9. }
Success #stdin #stdout 0s 3144KB
stdin
1000
stdout
0.50000