# how to order the elements

Given $$U = \{(p_1,q_1),(p_2,q_2),…., (p_N,q_N)\}$$, where $$0 and $$0, how to solve the following problem:

\begin{align} \max_{S\subseteq U }\max_\sigma&\quad \sum_{i=1}^{|S|}p_{\sigma_i}q_{\sigma_i}\Pi_{j=1}^{i-1}(1-p_{\sigma_j})\ s.t. & \quad |S|=K\le N. \end{align}

where $$\sigma$$ specifies the order of elements in $$S$$.

Suppose that we know the set of $$S$$, then $$\sigma$$ should order the elements by $$q$$. (Otherwise, show the contradiction by switching two elements)

My question is: Suppose that $$(p_n,q_n)$$ lies in $$S^*$$. Then when $$q_n$$ increases, it will still lie in $$S^*$$, but will $$(p_n,q_n)$$ be moved up?