Test Championship Mace
Coach Anil Kumble is mighty pleased with his team's performances in recent test matches which has made them World No. 1. However he is worried about the upcoming foreign tours. To counter this he employs a unique plan. He arranges the N national players in a straight line with a placard in their hand with their first class batting average witten on them. Now he chooses two numbers L and R (L<=R) and finds out the number of players who have their batting average less than a threshold X.
Can you be a part of elongating Indian Cricket Team's golden run on Test World Rank 1.
- First line consist of N and Q, number of players and the number of query asked by Kumble.
- Next lines contains N space seperated integers denoting average run of the ith player denoted by avg_run[i].
- Next Q line contains three integers L, R and X.
- Print Q lines output of each query.
- 1 ≤ N, Q ≤ 100000
- 1 ≤ L <= R ≤ 100000
- -1000000000 ≤ avg_run[i], X ≤ 1000000000
Input: 5 3 3 7 6 8 1 2 3 7 1 5 10 1 5 2 Output: 1 5 1
|Time Limit:||1 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|
Fetching successful submissions