<jupyter_start><jupyter_text>https://www.hackerearth.com/practice/data-structures/arrays/1-d/practice-problems/algorithm/monk-and-rotation-3/<jupyter_code>1
5 2
1 2 3 4 5

4 5 1 2 3
T = int(input())

for _ in range(T):
    n, k = map(int, input().split())
    k = k%n
    
    l = input().split()
    
    print(' '.join(l[n-k:] + l[:n-k]))
n = 3
k = 2
l = [1,2,3]
l[n-k:] + l[:n-k]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2111650485436893, 'fraction_numerical': 0.04854368932038835, 'mean_word_length': 3.13, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '277788', 'license': 'MIT', 'n_tokens_mistral': 212, 'n_tokens_neox': 192, 'n_words': 37, 'path': 'HackerEarth/Monk and Rotation.ipynb', 'repo_name': 'deepaksood619/Python-Competitive-Programming', 'size': '412'}