# Sum

Given N non negative numbers, the task is to answer M queries.

Each query is as follows:

Given u,v you need to find the pairwise product sum (u and v are zero indexed)

a

_{u}a

_{u}+ a

_{u+1}a

_{u+1}Â + a

_{u+1}a

_{u}Â + a

_{u+2}a

_{u+2}Â + a

_{u+2}a

_{u+1}Â + a

_{u+2}a

_{u}Â + ... + a

_{v}a

_{v}Â + a

_{v}a

_{v-1}Â + ... + a

_{v}a

_{u}

**Input**

0> 1> ... N-1>

__1>__1>

__2>__2>

...

...

__M>__M>

Â

Print the answer for each query in a seperate line.

Â

**Output**

Print the answer for each query in a seperate line.

**Sample Input**

```
```

5

2 0 1 3 3

3

0 2

1 2

3 4

**Sample Output**

```
```

7

1

27

**Constraints**

- u>=0, u
- v>=0, v
- u<=v
- N<=100000
- M<=100000
- 0 <= a
_{i}<= 10000

**Languages:**C,C++,Java