#include <iostream>
#include<bits/stdc++.h>
using ll = long long;
#define fo(i,start,end) for(int i = start;i<end;i++)
using namespace std;

int main() {
	// your code goes here
	vector<int>arr = {3,4,1,2,1,4};
	int n = 6;
	int l = 2 ; 
	int	r = 5; //one based index
	int sum = 0;
	fo(i,l-1,r){
		sum += arr[i];
	}
	cout<<"Sum of array in range "<<l<<" to "<<r<<" is:"<<sum<<endl;
	
	return 0;
}