#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <stdio.h>
using namespace std;
typedef long long ll;
int main() {
//string a;
//cin >> a;
ll size = 0; //a.length();
cin >> size;
double best = size*(size-1)/4;
for (int i = 0; i < size; i++)
{
long double x = ((size-i) * (size -i-1)) / double(4);
long double y = (i*(i-1)) / double(4);
y += x;
if (y + 0.0000001 < best)
best = y;
}
cout << fixed << setprecision(6) << best;
}
# |
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 |
- |