포럼
문제 ICPC00302

F. Fence Fee

설명

Generated from OpenStreetMap, ODBL 1.0

The National Crop Protection Commission (NCPC) is dedicated to supporting local farmers by offering subsidies that are proportional to the area of their crop fields. Each farmer can have several crop fields, each uniquely shaped but geometrically defined as a polygon, bounded by fences that meet only at the corners.

In a classic display of political bureaucracy, and to incentivize well-shaped fields, the NCPC will subsidize each crop field based on the square of its area. This, to reward well-encapsulated fields. They now require a tool that calculates the sum of the squared areas of these polygons to ensure that the subsidies are distributed fairly.

제약
입력 형식

The first line contains an integer \(F\) (\(3 \leq F \leq 1000\)), the number of fence line segments. The next \(F\) lines contain four integers each, \(x_1\), \(y_1\), \(x_2\), \(y_2\) (\(0 \leq x_1, y_1, x_2, y_2 \leq 1000\)), representing a straight-line fence section.

No two fence line segments intersect. Since fencing is both expensive and tedious, you may assume that every fence line segment is necessary and serves to bound fields. All fences farmers have are connected.

In other words, the graph that consists of endpoints and fences is planar, connected, and has no bridges.

출력 형식

Output a single line representing the sum of the squared areas of all the fields formed by the given fence sections. Your answer will be correct if it has an absolute or relative error of at most \(10^{-6}\).

예제 1
입력
5
0 0 0 1
0 1 1 1
0 0 1 0
1 0 2 0
1 1 2 0
출력
2.25
예제 2
입력
6
0 0 0 1
0 1 1 1
0 0 1 0
1 0 2 0
1 1 2 0
1 0 1 1
출력
1.25
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NCPC 2024

평가 및 의견

F. Fence Fee

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

F. Fence Fee

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8