Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7076 - Нийлбэр 5

 1/(1*2) + 1/(2*3) + 1/(3*4) + . . . + 1/(n*(n+1)) нийлбэрийг ол.

Input

n натурал тоо.

Output

Нийлбэрийг таслалаас хойш 6 оронгийн нарийвчлалтай гаргана. 

Example

Input:
9
Output:
0.9000


Нэмсэн:Bataa
Огноо:2019-01-31
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 ASM64 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE
Эх сурвалж:Математик

hide comments
2024-01-24 04:22:32
odoo bolitsgoo
2023-12-21 14:27:41
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n;
long double s = 0;
cin >> n;
for (long long i = 1; i <= n; i++) {
s = s + (1.0 / (i * (i + 1)));
}
cout << fixed << setprecision(6) << s;

return 0;
}
chadahguil bnu
deeliid zoriulaw
2023-06-24 13:14:21
#include <bits/stdc++.h>
using namespace std;

int main() {
long long n;
long double d = 0.;
cin >> n;
for(int i = 1;i <= n;i++){
d = d + 1 /(i * (i + 1));
}
cout << fixed << setprecision(6) << d;

return 0;
}
// enenii aldaag helj uguh hun bval heleed uguuch
2022-09-19 05:36:55
#include <iostream>
#include<math.h>
using namespace std;

int main() {double n,s;
cin>>n;
s=n/(n+1);
cout.setf(ios::fixed);
cout.precision(6);
cout<<s;

// your code here

return 0;
}
2021-12-24 05:12:14
naadh cin buruu bn

2019-07-30 06:23:30
#include <iostream>
#include<math.h>
using namespace std;

int main() {double n,s;
cin>>n;
s=n/(n+1);
cout.setf(ios::fixed);
cout.precision(6);
cout<<s;

// your code here

return 0;
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.