#include <iostream>

using namespace std;

int mean(int a[],int l,int r,int n){

int i,count=0,lin,rin,sum =0;

for(i=0;i<n;i++){

if(l==a[i]) lin=i;

if(r==a[i]) rin=i;

}

for(i=lin;i<=rin;i++){

sum+=a[i];

count++;

return sum/count;