#include <stdio.h>

int main() {
    int n, m;
    printf("Enter the number of elements (n): ");
    scanf("%d", &n);
    if (n < 0) {
        printf("Invalid input\n");
        return 1; 
    }
    int arr;
    printf("Enter %d elements of the array: ", n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
    }
    printf("Enter the number of positions to rotate (m): ");
    scanf("%d", &m);
    m = m % n;
    int temp;
    for (int i = 0; i < n; i++) {
        temp[(i + m) % n] = arr[i];
    }
    for (int i = 0; i < n; i++) {
        arr[i] = temp[i];
    }
    printf("Array after right rotation: ");
    for (int i = 0; i < n; i++) {
        printf("%d ", arr[i]);
    }
    printf("\n");

    return 0;
}