Question: Ada and coding tests Ada is a proficient programmer who loves to give coding tests. She maintains a list of marks she scored in these

Ada and coding tests
Ada is a proficient programmer who loves to give coding tests. She maintains a list of marks she scored
in these tests, denoted as a0,a1,dots.an., where ai represents the marks she obtained in the ith test.
One day, she grew curious and decided to analyse her performance in the tests she had attempted so
far. To do this, she wanted to determine the total hrarks she scored between two given tests. With
multiple queries of this nature, can you help her analyse her performance?
Input Format
The first line contains one integer n, representing the number of tests attempted by-Ada-so far.
The nextline contains nintegers, marks scored by her in n tests.
The next line contains one integer q, denoting the number of queries she has
The next q lines describe the test indices. Each line contains two integers, l and r, representing the tests
between which she wants to find out the total marks scored (including both l and r).
Constraints
3
 Ada and coding tests Ada is a proficient programmer who loves

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!