You are given 4 arrays of N size each. At a time u can take 1 value from each of the 4 arrays to form a quadruplet. How many quadruplets exist such that the sum of the quadruplet is less than or equal to M.

Constraints:-

1<=1000<=N

-10^5<=A[i]<=10^5

M<=10^9