Hard challenge

TimeLimit:2000MS  MemoryLimit:524288KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description
There are $n$ points on the plane, and the $i$th points has a value $val_i$, and its coordinate is $(x_i,y_i)$. It is guaranteed that no two points have the same coordinate, and no two points makes the line which passes them also passes the origin point. For every two points, there is a segment connecting them, and the segment has a value which equals the product of the values of the two points. Now HazelFan want to draw a line throgh the origin point but not through any given points, and he define the score is the sum of the values of all segments that the line crosses. Please tell him the maximum score.
Input
The first line contains a positive integer $T(1\leq T\leq5)$, denoting the number of test cases.
For each test case:
The first line contains a positive integer $n(1\leq n\leq5\times10^4)$.
The next $n$ lines, the $i$th line contains three integers $x_i,y_i,val_i(|x_i|,|y_i|\leq10^9,1\leq val_i\leq10^4)$.
Output
For each test case:
A single line contains a nonnegative integer, denoting the answer.
SampleInput
2
2
1 1 1
1 -1 1
3
1 1 1
1 -1 10
-1 0 100
SampleOutput
1
1100
Submit
题目统计信息详细
总AC数3
通过人数3
尝试人数3
总提交量3
AC率100.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: