시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 19 12 10 71.429%

문제

사각형 모양의 땅이 있다. 이 땅을 둘로 잘라서, 잘라진 두 다각형의 넓이를 최대한 비슷하게 하려고 한다.

땅을 자를 때에는 위의 그림처럼 각 꼭지점이나 그 중점만을 이용할 수 있다.

입력

첫째 줄에 사각형의 네 꼭지점의 좌표가 순서대로(시계방향이나 반시계방향으로) 주어진다. 각 꼭지점의 좌표는 절대값이 10,000을 넘지 않는 정수이다.

입력으로 주어지는 사각형은 볼록 사각형 (모든 각이 180도보다 작은 사각형) 이다.

출력

첫째 줄에 두 면적을 출력한다. 작은 면적을 먼저 출력하도록 한다. 절대/상대 오차는 10-3까지 허용한다.

예제 입력 1

0 1 6 0 5 2 2 3

예제 출력 1

4.375 5.125
W3sicHJvYmxlbV9pZCI6IjIxNzUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWI1NDUgXHVjNzkwXHViOTc0XHVhZTMwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWMwYWNcdWFjMDFcdWQ2MTUgXHViYWE4XHVjNTkxXHVjNzU4IFx1YjU0NVx1Yzc3NCBcdWM3ODhcdWIyZTQuIFx1Yzc3NCBcdWI1NDVcdWM3NDQgXHViNDU4XHViODVjIFx1Yzc5OFx1Yjc3Y1x1YzExYywgXHVjNzk4XHViNzdjXHVjOWM0IFx1YjQ1MCBcdWIyZTRcdWFjMDFcdWQ2MTVcdWM3NTggXHViMTEzXHVjNzc0XHViOTdjIFx1Y2Q1Y1x1YjMwMFx1ZDU1YyBcdWJlNDRcdWMyYjdcdWQ1NThcdWFjOGMgXHVkNTU4XHViODI0XHVhY2UwIFx1ZDU1Y1x1YjJlNC48XC9wPlxyXG5cclxuPHAgc3R5bGU9XCJ0ZXh0LWFsaWduOiBjZW50ZXI7XCI+PGltZyBhbHQ9XCJcIiBzcmM9XCJcL0p1ZGdlT25saW5lXC91cGxvYWRcLzIwMTAwOFwvbGFuZC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SBkaXJlY3RseSBhYm92ZSB0aGUgY2FrZTsgdGhlIGZpbmFsIHRlc3QgY2FzZSBpcyBmb2xsb3dlZCBieSBhIGxpbmUgY29udGFpbmluZyBlaWdodCB6ZXJvcy4gTm8gdGhyZWUgcG9pbnRzIHdpbGwgYmUgY29sbGluZWFyLCBhbGwgcXVhZHJpbGF0ZXJhbHMgYXJlIGNvbnZleCwgYW5kIGFsbCBjb29yZGluYXRlcyB3aWxsIGhhdmUgYWJzb2x1dGUgdmFsdWVzIG9mIDEwMDAwIG9yIGxlc3MuPFwvcD5cclxuIiwib3V0cHV0IjoiPHA+Rm9yIGVhY2ggY2FrZSwgdGhlIGNha2UgbnVtYmVyIGZvbGxvd2VkIGJ5IHRoZSB0d28gYXJlYXMsIHNtYWxsZXIgZmlyc3QsIHRvIHRocmVlIGRlY2ltYWwgcGxhY2VzIG9mIHByZWNpc2lvbjxcL3A+XHJcbiIsImhpbnQiOiIiLCJvcmlnaW5hbCI6IjEiLCJwcm9ibGVtX2xhbmdfY29kZSI6Ilx1YzYwMVx1YzViNCJ9XQ==

출처

ACM-ICPC > Regionals > North America > East Central North America Regional > 2003 East Central Regional Contest H번

  • 잘못된 번역을 찾은 사람: bupjae
  • 빠진 조건을 찾은 사람: f52985