#include #include #include #include #include #include #include constexpr double PI = 3.1415926535898; struct Pt { int64_t x; int64_t y; bool operator<(const Pt& other) const { if (y == 0 && x <= 0) { if(other.y == 0 && other.x <= 0) { return x > other.x; } return true; } if (y > 0) { if (other.y == 0 && other.x <= 0) { return false; } if (other.y > 0) { int64_t det = x * other.y - other.x * y; if (det == 0) { return y < other.y; } return det < 0; } return true; } if (y == 0 && x >= 0) { if (other.y == 0 && other.x <= 0) { return false; } if (other.y > 0) { return false; } if (other.y == 0 && other.x > 0) { return x < other.x; } return true; } if (y < 0) { if (other.y < 0) { int64_t det = x * other.y - other.x * y; if (det == 0) { return y > other.y; } return det < 0; } return false; } return false; } }; std::vector probs; int main() { int n, k, d; std::cin >> n >> k >> d; char point; std::vector points(n); for (int i = 0; i < n; i++) { int x1, x2, y1, y2; std::cin >> x1 >> point >> x2 >> y1 >> point >> y2; points[i].x = std::abs(x1) * 100LL + x2; points[i].y = std::abs(y1) * 100LL + y2; if (x1 < 0) points[i].x *= -1; if (y1 < 0) points[i].y *= -1; } if (k == 1) { std::cout << std::setprecision(30) << PI * d << std::endl; return 0; } probs.resize(n - 1); probs[n - 2] = double(k) * double(k - 1) / double(n) / double(n - 1); for (int i = n - 3; i >= k - 2; i--) { probs[i] = probs[i + 1] / double(i + 1) * double(i + 3 - k); } for (int i = k - 3; i >= 0; i--) { probs[i] = 0; } double tot = 0.0; for (int i = 0; i < n; i++) { std::vector others; for (int j = 0; j < n; j++) { if (i != j) { others.push_back({ points[j].x - points[i].x, points[j].y - points[i].y }); } } std::sort(others.begin(), others.end()); int opp = 0; for (int j = 0; j < n - 1; j++) { if (opp == j) { opp = (j + 1) % (n - 1); } while (true) { int64_t cross = others[j].x * others[opp].y - others[j].y * others[opp].x; int64_t dot = others[j].x * others[opp].x + others[j].y * others[opp].y; if (cross > 0) break; if (cross == 0 && dot > 0 && opp <= j) break; opp = (opp + 1) % (n - 1); } double len = 1e-2 * sqrt(double(others[j].x) * double(others[j].x) + double(others[j].y) * double(others[j].y)); int cnt = (opp - j - 1 + (n - 1)) % (n - 1); if (cnt < 0) exit(-1); tot += len * probs[cnt]; } } tot += PI * d; std::cout << std::setprecision(30) << tot << std::endl; }