# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1188526 | qwusha | Flight to the Ford (BOI22_communication) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#define int long long
#define ld long double
signed main() {
string s;
cin >> s;
int n = s.size();
ld res = 0;
for (int i = 0; i < n / 2; i++) {
res += i;
}
for (int i = n - 1; i >= n / 2; i--) {
res += (n - 1 - i);
}
res /= 2;
cout << setprecision(15) << res << '\n';
}