#P10671. BZOJ1278 向量 vector

BZOJ1278 向量 vector

Problem Description

The weight of a two-dimensional vector (x,y)(x, y) is defined as x2+y2x^2 + y^2. Given a set consisting of nn two-dimensional vectors, find a subset such that the weight of the sum of the vectors in this subset is as large as possible.

Input Format

The first line contains a positive integer nn, indicating that there are nn vectors.

The next nn lines each contain 22 real numbers, representing the nn vectors (xi,yi)(x_i, y_i).

Output Format

Output 11 real number, i.e., the maximum possible weight of the vector sum, accurate to 33 digits after the decimal point.

3
1 1
1 0
0 -1
5.000

Hint

Constraints: it is guaranteed that 1n1000001 \leq n \leq 100000.

Translated by ChatGPT 5