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

25226번 - Cookie Cutter 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
8 초 (추가 시간 없음) 1024 MB151221613.115%

문제

Everyone loves chocolate chip cookies! Which unfortunately means sharing sometimes. In this case, you have generously agreed to split a square chocolate chip cookie with your friend.

Because it is your cookie, you get to choose how to cut the cookie, and which piece to give to your friend. You can split the cookie along any straight line that passes through the cookie; the line need not be axis-aligned.

You know the location of all chocolate chips in the cookie. Because you prefer a cookie that is dense with chocolate chips, you want to optimize your cut to produce the best possible split. You accomplish this by maximizing the difference between the fraction of chocolate chips in your piece and the fraction of cookie area in your piece.

입력

The first line of input contains two space-separated integers $n$ (2ドル \leq n \leq 10,000円$) and $m$ (1ドル \leq m \leq 3,000円$), where $n$ is the side length of the square cookie, and $m$ is the number of chocolate chips in the cookie.

The next $m$ lines each contain two space-separated integers $x$ and $y$ (0ドル < x, y < n$) defining the location of a chocolate chip in the cookie. All chocolate chip locations are distinct. If a chocolate chip lies exactly on the cut, you can decide which piece of the cookie it goes to.

출력

Output a real number, which is the maximum possible value for $\frac{b}{m} - \frac{a}{n^2},ドル where $a$ is the area of cookie that you get, and $b$ is the number of chocolate chips in your piece of the cookie. The answer is accepted with absolute or relative error at most 10ドル^{-6}$.

제한

예제 입력 1

5 8
1 1
1 2
1 3
2 1
3 1
3 4
4 1
4 2

예제 출력 1

0.375

힌트

Illustration of Sample Case 1.

출처

ICPC > Regionals > North America > North America Championship > North America Championship 2022 B번

Camp > Petrozavodsk Programming Camp > Summer 2022 > Day 1: Welcome Contest C번

  • 문제를 만든 사람: Lewin Gan
(追記) (追記ここまで)

출처

대학교 대회

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

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