
Optimal Point on a Line
You are given n points on a line with their coordinates x i. Find the point x so the sum of distances to the given points is minimal. Input The first […]
You are given n points on a line with their coordinates x i. Find the point x so the sum of distances to the given points is minimal. Input The first […]
You are a given a list of integers $a_1, a_2, \ldots, a_n$ and $s$ of its segments $[l_j; r_j]$ (where $1 \le l_j \le r_j […]