please tell what we have to do as i am not able to make any logic for the given question
I did not understand how the question is working
you have to solve this question in nk complexity. that might give you a hint. first try to thing about nk*log k soln and then try to optimise it.