#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
int main () {
int n;
cin >> n;
ld ans = 0;
for (int i = 2; i < n; i++) {
ans += min(0.5 * (i - 1), 0.5 * (n - i));
}
cout << fixed << setprecision(3) << ans << '\n';
}
# |
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 |
1 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 |
1 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 |
- |