题号:NC222408
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
There are

jewels under the sea, and you want to salvage all the jewels. Image that the sea is a 3D coordinate system, and that you are at
_%7B%7D)
while the

-th jewel is at
~(z_i%20%5Cge%200))
initially. You can salvage one jewel immediately(regardless of other jewels wherever they are) with strength

at every non-negative integer moment where d denotes the distance between you and the jewel you salvage at that moment. However, the jewels sink. Specifically, for the

-th jewel, it will be at
)
after

seconds. So you want to know the minimum possible total strength to salvage all the jewels.
输入描述:
The first line contains one integer
, denoting the number of jewels.
Following
lines each contains four integers
, denoting the jewels' initial positions and sinking velocities.
输出描述:
Output one line containing one integer, denoting the minimum possible total strength to salvage all the jewels.