The first line contains 2 space separated integers N and K The next line contains N space separated integral elements of the list

pls help me with the code
i am not able to solve