Logo
(追記) (追記ここまで)

29635번 - Great Wall of Flatland 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB252320100.000%

문제

Once Emperor of Flatland Hu Shiandgi decided to strengthen his great empire and commanded to build the Great Wall of Flatland. At that moment Flatland consisted of a number of Warring Kingdoms. Each of the them had triangular shape and they did not overlap with each other. Along the perimeter of each of them there were unbreakable walls, and in every corner of each kingdom there was a guard tower.

The land had been distributed by the previous ruler of Flatland in such a manner that from any of the towers on a clear day one could see any other. As we know from the writings of the Great Flatland Mathematicians this is possible only in the case when there are no three towers on a same straight line.

In addition, since the imperial tax office had to collect taxes from all the Warring Kingdoms, and tax officers had to carry with them large sums of money, the country was constructed in such a way that the tax officer could get from any of the Kingdoms to any other using only unbreakable walls, possibly of different Kingdoms.

To find out how much money should be allocated for the construction of the Great Wall of Flatland, Hu Shiandgi needs to know the total length of all unbreakable walls, which separate the territory of some Warring Kingdom from the territory not belonging to Flatland.

입력

First line of the input file contains an integer number $m$ --- the number of Warring Kingdoms (1ドル \le m \le 1000$). Each of the following $m$ lines contains six numbers $x_1,ドル $y_1,ドル $x_2,ドル $y_2,ドル $x_3,ドル $y_3$ --- coordinates of vertices of triangle that describes the area of the corresponding Warring Kingdom. All coordinates are integer and do not exceed 10ドル^4$ by absolute value.

출력

Output the length of The Great Wall of Flatland. You answer should be accurate up to 10ドル^{-4}$.

제한

예제 입력 1

3
0 0 3 0 0 2
3 0 0 2 2 4
3 0 2 4 5 1

예제 출력 1

14.3071357893652

예제 입력 2

4
0 0 1 5 1 2
1 5 1 2 3 3
0 0 3 3 1 2
0 0 3 3 6 3

예제 출력 2

17.6356505708383

노트

Illustrations for the examples:

출처

Olympiad > Russian Olympiad in Informatics > Internet Olympiads in Informatics > 2009-2010 Season > February 13, 2010 B번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /