Stucked in a problem : Minimum Cost to Light Points on an Infinite Grid
Difference between en2 and en3, changed 73 character(s)
You are given an infinite 2-D grid.↵

There are:
       
    N fixed points on the grid that must be lit.
        
    K types of light towers.↵

Each tower type i has:
       
- A cost per unit distance ki (for each one unit of radius, the cost is ki)↵

You may place any number of towers of any type at any grid position.
     
You may choose any non-negative radius r for each placed tower.
     ↵
You can use each tower at most once.   


If you place a tower of type i with radius r, then:↵
- It lights all points within distance r from its position.↵
- Its cost is: r * ki↵

A fixed point is considered lit if it lies within the radius of at least one placed tower.↵

Your task is to light all N fixed points with minimum total cost.↵

Constraints↵
1 <= N <= 2*10^5,        ↵
1 <= K <= 2*10^5,      ↵
-1e9 <= xi, yi <= 1e9,       ↵
1 <= ki <= 1e9↵

distance between two point : dist(a, b) = sqrt( (ax &mdash; bx)^2 + (ay &mdash; by)^2 )↵

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English Rankit 2026-01-04 20:36:59 73
en2 English Rankit 2026-01-04 19:22:34 24
en1 English Rankit 2026-01-04 19:20:50 925 Initial revision (published)