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.|

RGB7078 - Нийлбэр 7

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

Input

Сондгой натурал тоо n өгөгдөнө.

Output

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

Example

Input:

7

Output:

0.444444


Нэмсэн: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
2023-12-21 14:34:45
#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=i+2) {
s = s + (1.0 / (i * (i + 2)));
}
cout << fixed << setprecision(6) << s;

return 0;
}
icheecee
deeliid zoriulaw
2021-01-25 07:40:25


Last edit: 2021-01-25 07:43:16
2019-11-30 04:41:32
#include<iostream>
using namespace std;
int main ()
{
float i,j,n,k,s=0;
cin>>n;
for(i=1;i<=n;i=i+2) {
k=1/(i*(i+2));
s=s+k;
}
printf("%.6f\n",s);
return 0;
}bayrlaj yvaarai zuv shu gsh haha
2019-07-30 06:24:34
bi bol ergui enxtaivan
2019-07-30 06:24:04
#include <iostream>
#include<math.h>
using namespace std;

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

// your code here

return 0;
}
2019-03-13 10:24:25
#include<bits/stdc++.h>

using namespace std;

int main () {
float i,j,n,k,s;
cin>>n;

s=0;

for(i=1;i<=n;i=i+2) {
k=1/(i*(i+2));
s=s+k;
}
printf("%.6f\n",s);

return 0;

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