#include #include #include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); long long n; cin >> n; // Just try the most efficient approach of brute force calculating the geometric series. Likely if contestants do this they can also solve the recursion, // but this should provide a good upper bound of the accuracy that can be achieved by any iterating algorithm. std::vector xs(n), ys(n); for (int i = 0; i < n; i++) { cin >> xs[i] >> ys[i]; } long double len2 = 0.0; long double ar = 0.0; for (int i = 1; i < n; i++) { len2 += (xs[i] - xs[i-1]) * (xs[i] - xs[i-1]) + (ys[i] - ys[i-1]) * (ys[i] - ys[i-1]); ar += 0.5f * (ys[i] + ys[i-1]) * (xs[i] - xs[i-1]); } long double area = 0.0, prev = -1.0; long double currlen2 = 1.0; long long i = 0; while (prev != area) { prev = area; area += currlen2 * ar; currlen2 *= len2; i++; } cerr << "Iterations: " << i << '\n'; cout << setprecision(19) << sqrt(3) / 4 + 3 * area << '\n'; return 0; }