For this Question: Given an unsorted array arr[] of N integers and a sum. The task is to count the number of subarrays which adds to a given number.The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. 
Each test case contains an integer N denoting the size of the array and integer denoting the value of the sum in the first line. 
The next line contains N space separated integers forming the array.

Constraints:
1 <= T <= 100
1 <= N <= 10^4
-105 <= arr[i] <= 10^5
-105 <= sum <= 10^5

Note:- Sum of N over all test cases does not exceed 10^5For each testcase, in a new line, print the count of the subarrays which add to the given sum.Sample Input
2
5 -10
10 2 -2 -20 10
6 33
1 4 20 3 10 5

Sample Output
3
1

Explanation:
Testcase 1: Subarrays with sum -10 are: [10, 2, -2, -20], [2, -2, -20, 10] and [-20, 10].
Testcase 2: Subarray with sum 33 is: [20, 3, 10]., I have written this Solution Code: 
// author-Shivam gupta

#include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795

#define MOD 1000000007

#define read(type) readInt<type>()
#define max1 1000001
#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'
const double pi=acos(-1.0);

typedef pair<int, int> PII;

typedef vector<int> VI;

typedef vector<string> VS;

typedef vector<PII> VII;

typedef vector<VI> VVI;

typedef map<int,int> MPII;

typedef set<int> SETI;

typedef multiset<int> MSETI;

typedef long int li;

typedef unsigned long int uli;

typedef long long int ll;

typedef unsigned long long int  ull;

bool isPowerOfTwo (int x)
{
  /* First x in the below expression is
    for the case when x is 0 */
  return x && (!(x&(x-1)));
}
void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
ll power(ll x, ll y, ll p)
{
    ll res = 1;      // Initialize result

    x = x % p;  // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

// Returns n^(-1) mod p
ll modInverse(ll n, ll p)
{
    return power(n, p-2, p);
}

// Returns nCr % p using Fermat's little
// theorem.

int main(){
int t;
cin>>t;
while(t--){
    int n;
    cin>>n;
    int a[n];
    li sum;
    cin>>sum;
    ll cur=0;
    unordered_map<ll,int> m;
    ll cnt=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        cur+=a[i];
        if(cur==sum){
        cnt++;}
        if(m.find(cur-sum)!=m.end()){
        cnt+=m[cur-sum];}
        m[cur]++;
    }
    out(cnt);

}
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?