#include <bits/stdc++.h>
using namespace std;
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
int n;
cin>>n;
int k=n/2;
double res=((double)(k-1)*k)/2;
//cout<<res<<'\n';
if (n%2==0) cout<<res;
else cout<<res+((double)((n+1)/2-1))/2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
1st numbers differ - expected: '100800.5000000000', found: '-0.0000000000', error = '1.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
1st numbers differ - expected: '1.0000000000', found: '-0.0000000000', error = '1.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
1st numbers differ - expected: '1.0000000000', found: '-0.0000000000', error = '1.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
1st numbers differ - expected: '100800.5000000000', found: '-0.0000000000', error = '1.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |