Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Little Subarray Sum

Limits 1s, 512 MB

Given an array of N numbers and two indices, determine the sum of the numbers in the array between (and including) those two indices.

Take this array for example:

13 7 20 1 8

The sum of the numbers between and including the indices 1 and 4 is:

7 + 20 + 1 + 8 = 36

Input

The first line of the input will contain three integers N, A, B (0 < N < 100, 0 ≤ A < B < N). A and B are the two indices.

The following line will contain N integers, each between 1 and 1000.

Output

Print the sum of the subarray.

Sample

InputOutput
5 1 4
13 7 20 1 8 
36


    Discussion
    Statistics

    99% Solution Ratio

    ikaadilEarliest, 9M ago

    ikaadilFastest, 0.0s

    N550999.Lightest, 0 B

    saitotaShortest, 44B

    Submit

    Login to submit