For this Question: Given an array of N integers, your task is to find the maximum value of the sum of its subarray modulo M, i. e., find the sum of each subarray mod M and print the maximum value of this after modulo operation.The first line of input contains two space-separated integers N and M, the next line of input contains N space-separated integers depicting value of the array.

<b>Constraints:-</b>
1 < = N < = 100000
1 < = M < = 10000000000
1 < = Arr[i] < = 10000000000Print the maximum value of sum modulo m.Sample Input:-
5 13
6 6 11 15 2

Sample Output:-
12

Explanation:
[6, 6] is subarray is maximum sum modulo 13

Sample Input:-
3 15
1 2 3

Sample Output:-
6

Explanation:
Max sum occurs when we take the whole array, I have written this Solution Code: #include<bits/stdc++.h>
#define int long long
using namespace std;

// Return the maximum sum subarray mod m.
int maxSubarray(int arr[], int n, int m)
{
    int x, prefix = 0, maxim = 0;

    set<int> S;
    S.insert(0);

    // Traversing the array.
    for (int i = 0; i < n; i++)
    {
        // Finding prefix sum.
        prefix = (prefix + arr[i])%m;

        // Finding maximum of prefix sum.
        maxim = max(maxim, prefix);

        // Finding iterator pointing to the first
        // element that is not less than value
        // "prefix + 1", i.e., greater than or
        // equal to this value.
        auto it = S.lower_bound(prefix+1);

        if (it != S.end())
            maxim = max(maxim, prefix - (*it) + m );

        // Inserting prefix in the set.
        S.insert(prefix);
    }

    return maxim;
}

// Driver Program
signed main()
{
      
    int n,m;
cin>>n>>m;
int a[n];
for(int i=0;i<n;i++){
    cin>>a[i];
}
    cout << maxSubarray(a, n, m) << endl;
    return 0;
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?