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

24487번 - Multiple Choice Test 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB112453234.043%

문제

The cows are taking a multiple choice test. But instead of a standard test where your selected choices are scored for each question individually and then summed, in this test your selected choices are summed before being scored.

Specifically, you are given $N$ (2ドル\le N\le 10^5$) groups of integer vectors on the 2D plane, where each vector is denoted by an ordered pair $(x,y)$. Choose one vector from each group such that the sum of the vectors is as far away from the origin as possible.

It is guaranteed that the total number of vectors is at most 2ドル\cdot 10^5$. Each group has size at least 2ドル,ドル and within a group, all vectors are distinct. It is also guaranteed that every $x$ and $y$ coordinate has absolute value at most $\frac{10^9}{N}$.

입력

The first line contains $N,ドル the number of groups.

Each group starts with $G,ドル the number of vectors in the group, followed by $G$ lines containing the vectors in that group. Consecutive groups are separated by newlines.

출력

The maximum possible squared Euclidean distance.

제한

예제 입력 1

3
2
-2 0
1 0
2
0 -2
0 1
3
-5 -5
5 1
10 10

예제 출력 1

242

힌트

It is optimal to select $(1,0)$ from the first group, $(0,1)$ from the second group, and $(10,10)$ from the third group. The sum of these vectors is $(11,11),ドル which is squared distance 11ドル^2+11^2=242$ from the origin.

출처

Olympiad > USA Computing Olympiad > 2021-2022 Season > USACO 2022 January Contest > Platinum 3번

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

출처

대학교 대회

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

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