A list of integers is given. For each of $Q$ queries a b, print the slice l[a:b] (Python semantics, negative indices allowed) as a Python list literal, one per line.
Input
Line 1: the list. Line 2: $Q$. Next $Q$ lines: two integers $a$, $b$.
Output
Print each requested slice, one per line.
Example 1
Input
10 20 30 40 50 4 1 4 0 3 -3 -1 -4 5
Output
[20, 30, 40] [10, 20, 30] [30, 40] [20, 30, 40, 50]
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.