For this Question: The government has launched a missile to destroy the enemy bases which are represented by a 1-indexed array of N integers.
At the time of launch, all the enemy bases which have defense lower than or equal to A will be destroyed immediately. Then after, each destroyed defense will act as government source and will lower the enemy base defense by A when it attacks any particular base. If the current base is i (1 <= i < = N) then on the first day it will attack i+1 and i-1 base the next day it will attack the i+2 and i-2 base (the attack happens only if a base exists at the attack position). The base will be destroyed if its defense goes below or equal to 0.
Since the missile is costly, the government wants to know the minimum A requires so that the project can be ended within D days.
For more clarification see the example
Note:- Only the defenses which were destroyed at the time of launch will act as a sourceFirst line of input contains two space separated integer N and D. Second line of input contains N space separated integers denoting the value of the Array.

Constraints:-
1 < = N < = 100000
1 < = Arr[i] < = 100000000
1 < = D < = 10000Print the minimum attack power requires to complete the project within D days.Sample Input:-
3 1
5 10 5

Sample Output:-
5

Explanation:-
1st and 3rd defense will be destroyed immediately then at first day 1st will attack 2nd defense and lowers its defense by 5 and on the same day 3rd defense will also attack the second and destroys it.

Sample Input:-
6 3
2 15 4 2 6 9

Sample Output:-
5

Explanation:-
After launch :- 0 15 0 0 6 9 (1st 3rd and 4th will act as source)
Day 1:- 0 5 0 0 1 9
Day 2:- 0 0 0 0 0 4
Day 3:- 0 0 0 0 0 0, I have written this Solution Code: #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 max1 100001
#define MOD 1000000007

#define read(type) readInt<type>()
#define int long long
#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'

void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int n,d;
int a[max1],pre[max1];

bool check(int A){
    int cnt=0;
FOR(i,n){
if(a[i]<=A){cnt++;}
pre[i]=cnt;
}
int ans;
FOR(i,n){
    if(a[i]>A){
ans=pre[i];
if(i>d){ans-=pre[i-d-1];}
if(i+d<n){ans+=pre[i+d]-pre[i];}
else{ans+=pre[n-1]-pre[i];}
//out1(A);out(ans);
if(ans*A<a[i]){return false;}
}}
return true;
}
signed main(){
    fast();

cin>>n>>d;
FOR(i,n){cin>>a[i];}
int low=1;
int high=10e10+1;
while(low<high){
    int mid=low+high;
    mid=mid/2;
    if(check(mid)==true){high=mid;}
    else{
        low=mid+1;
    }

}
cout<<low<<endl;

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