Problem Description

Read n integers and q queries (l r). For each query output bitwise AND of a[l..r] (1-based).

Input Format

First line n q. Second line n integers. Next q lines: l r.

Output Format

q lines answers.

Sample Test Case

Input:
5 2 7 3 15 8 10 1 3 2 5
Output:
3 0

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next