Two days ago, the soldier of love ask a question to me.The problem can be described by linear programming.
For this question, I find that I can't solve it.after that, ZZQ told me that it can be transformed into an equivalent problem:
At first there are $N(1 \leq N \leq 3*10^{5})$segments, the i-th segment cover interval$[L_i, R_i]$($1 \leq L_i \leq R_i \leq 10^{6}$)
Then there are $M (1 \leq M \leq 3*10^{5})$ groups, the i-th group contains $K_i(1 \leq K_i \leq 3*10^{5}$) points's positions, which are respectively $P_1, P_2, ......, P_{k_i}$. For Convenience, we make $1 \leq P_1 < P_2 < ...... < P_{k_i} \leq 10^{6}$
we can also know the total number of points in all groups is no more than $3*10^5$
now the problem is that for each group, we want to know the total number of the segments, which include at least one given point in this group.