@Simd First, replace the floating point coordinates with consecutive integers by sorting and renumbering. Then, go through the points in order of increasing x, and increasing y for equal x. Maintain a
Fenwick tree holding, for each value of y, the total weight of points processed so far with that y value; then each point's answer is obtained with one query to the Fenwick tree. The time complexity is n log(n).