while True: try: total_num, want_num = list(map(int, input().split(" "))) current_list = list(map(int, input().split(" "))) ...