Very Simple Question

All submissions for this problem are available.
Chef studies in a good School where programming is taught,
Chef 's Teacher Sameer Srivastava knows that chef knows basic stuffs of programming,to teach him more about programming his teacher gave him a Very Simple Question.
Description of question :
Chef has an array A of N numbers.
His teacher give him two numbers a and b and chef has to find
number of elements in array such that A[i] ≥ a and A[i] ≤ b where 1 ≤ i ≤ n and A[i] denotes the i^{th} element of array.
Input:
The first line of input contains a single integer N denoting the number of elements in the array A.
Second Line contains N space separated Integers.
Third line contains Q ,the number of queries.
Output
For each query output a single Integer giving the output of the problem.
Constraints
 1 ≤ N, Q ≤ 100000
 1 ≤ a ≤ b ≤ 10^{9}
 1 ≤ A[i] ≤ 10^{9}
Subtasks
Subtask #1 : (30 points)
Subtask #2 : (70 points)
Example
Input:7
2 5 6 7 1 3 4
2
1 7
3 5
Output: 7
3
Author:  abhishek20113 
Tags  abhishek20113 
Date Added:  20032016 
Time Limit:  1  1.5 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions