#557
Unrated
Multiple Choice Test
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

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 NN (2N1052\le N\le 10^5) groups of integer vectors on the 2D plane, where each vector is denoted by an ordered pair (x,y)(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 21052\cdot 10^5. Each group has size at least 22, and within a group, all vectors are distinct. It is also guaranteed that every xx and yy coordinate has absolute value at most 109N\frac{10^9}{N}.

입력

The first line contains NN, the number of groups.

Each group starts with GG, the number of vectors in the group, followed by GG 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

점수

In test cases 1-5, the total number of vectors is at most 10310^3.In test cases 6-9, every group has size exactly two.Test cases 10-17 satisfy no additional constraints.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.