Interval Less Query
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given an array of size , answer queries of the next kind: how many numbers on interval have value less than .
Input
The first line contains the size of array. The next line contains integers. Number of queries is given in the next line. Each of the next lines contains one query: three integers and .
Output
For each query print in a separate line how many numbers on have value less than .
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 33%