Circular array rotation Java
The array may be up to 105 elements long.  If you actually perform the rotation, then you will be copying at least 105 elements.  (You actually do ridiculously more work, as @JoeC and @OhadR have both pointed out.)

However, there will be at most 500 queries.  It would be nice if you didn't have to modify 105 entries just to satisfy 500 queries.  You don't actually need to perform the rotation — you only need to pretend to have performed the rotation.

import java.util.Scanner;

public class CircularArrayRotation {
    /**
     * Performs one query.
     *
     * @param a  The original array
     * @param k  The number of right circular rotations
     * @param m  The index of the rotated array to retrieve
     */
    public static &lt;T&gt; T query(T[] a, int k, int m) {
        int n = a.length;
        return a[(((m - k) % n) + n) % n];
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt(), k = sc.nextInt(), q = sc.nextInt();
        sc.nextLine();                          // End of first line

        String[] a = sc.nextLine().split(" ");  // Second line

        while (q-- &gt; 0) {                       // Perform q queries
            System.out.println(query(a, k, sc.nextInt()));
        }
    }
}


Strictly speaking, you don't even need to parse the ai as integers — you just need to read and regurgitate them.  You also don't need to store all q queries — you can just reply to each one as soon as you read m.