Function to return the number of subarrays of the given array such that the remainder when dividing the sum of its elements by K is equal to the number of its elements
static int sub_arrays ( int [ ] a , int n , int k ) {