2 人解决,3 人已尝试。
4 份提交通过,共有 8 份提交。
8.6 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
There are $n$ weighted points in a plane. Point $i$ is at $(x_i, y_i)$ and has weight $w_i$.
In this problem, we need to find a special center of these points. The center is a point $(X, Y)$ such that $\sum_{i=1}^n \max(|X-x_i|, |Y-y_i|) \cdot w_i$ is minimum.
The input starts with one line containing exactly one integer $T$, which is the number of test cases. $T$ test cases follow.
Each test case begins with one line containing one integer $n$. $n$ lines follow. Each line contains three space-separated real numbers $x_i$, $y_i$, and $w_i$. $x_i$, $y_i$ and $w_i$ have exactly $2$ digits after the decimal point.
Limits:
For each test case, output one line containing Case #x: y
, where x
is the test case number (starting from 1) and y
is the answer.
y
will be considered correct if it is within an absolute or relative error of $10^{-6}$ of the correct answer.
3 2 0.00 0.00 1.00 1.00 0.00 1.00 4 1.00 1.00 1.00 1.00 -1.00 1.00 -1.00 1.00 1.00 -1.00 -1.00 1.00 2 0.00 0.00 1.00 1.00 0.00 2.00
Case #1: 1.0 Case #2: 4.0 Case #3: 1.0
2 人解决,3 人已尝试。
4 份提交通过,共有 8 份提交。
8.6 EMB 奖励。