• + 0 comments

    def rotateLeft(d, arr): return arr[d:]+arr[:d]#for left rotation

    if name == 'main': fptr = open(os.environ['OUTPUT_PATH'], 'w')

    first_multiple_input = input().rstrip().split()
    
    n = int(first_multiple_input[0])
    
    d = int(first_multiple_input[1])
    
    arr = list(map(int, input().rstrip().split()))
    
    result = rotateLeft(d, arr)
    
    fptr.write(' '.join(map(str, result)))
    fptr.write('\n')
    
    fptr.close()
        #FOR RIGHT ROTATION
        return arr[-d:]+arr[:-d]
    

    #