please anyone help me in solving this

Правка en4, от helloIamCristiano, 2022-10-05 13:29:59

We have 2 arrays $$$A$$$ and $$$B$$$ of length $$$n$$$ each. We are required to pick $$$k$$$ elements from both the arrays say $$$A_{i_{1}}, A_{i_{2}}, ... A_{i_{k}}$$$ and $$$B_{i_{1}}, B_{i_{2}}, ... B_{i_{k}}$$$ such that the sum $$$A_{i_{1}} + A_{i_{2}} + ... + A_{i_{k}} > \lfloor{\frac{S_{A}}{2}}\rfloor$$$ and $$$B_{i_{1}} + B_{i_{2}} + ... + B_{i_{k}} > \lfloor{\frac{S_{B}}{2}}\rfloor$$$. Here $$$S_{A}$$$ and $$$S_{B}$$$ denote the sum of the arrays A and B respectively.$$$\newline$$$ We also want to print the indices we have chosen, if such a choice is possible.$$$\newline$$$ Also, pay attention to the fact that we are picking elements from $$$B$$$ with the same indices $$${i_{1}, i_{2}, ... , i_{k}}$$$ that we have used for $$$A$$$.$$$\newline$$$ Constraints :- $$$A_{i}, B_{i} \le 10^{9}$$$ and, size of the arrays $$$\le 10^{5}$$$. Please can anyone help me in solving this?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en5 Английский helloIamCristiano 2022-10-05 13:30:29 1 Tiny change: 'ving this?' -> 'ving this??'
en4 Английский helloIamCristiano 2022-10-05 13:29:59 26
en3 Английский helloIamCristiano 2022-09-04 10:38:13 42 Tiny change: '10^{5}$.\n' -> '10^{5}$.\nPlease can anyone help me in solving this?'
en2 Английский helloIamCristiano 2022-08-29 22:05:44 162
en1 Английский helloIamCristiano 2022-08-29 21:18:57 661 Initial revision (published)