SEQ5  How many subsequences
Tom has again maths , and the teacher writes countless tables with exercises .... so boring. Then he remembers an old problem of informatics that he thought in a dream . He remembered , he has a number of positive integers and the job was to know how many subsequences that have between L and U distinct elements exist in that range. So the boring hour will pass quicker . But he needs your help , he is to exhausted after two hours of math with the agitated teacher .
Input
The first line of input file contains positive N, L, U. following N lines will contain a positive integer, each representing an element of the series.
Output
The first line of the output will display the number of sequences containing between L and U distinct elements.
Example
Input: 4 1 2 231 19 7 19 Output: 8 Notes: 1<= L <= U <= N <= 2^20 The value of an item number is a positive integers [1,2^321]; A subsequence is a lot of items that appear on consecutive positions in the initial row. Be carefull with certain languages.Large imput data. Tom thanks you for solving this problem and he awards you with points.
hide comments
Mark Gordon:
20121002 04:52:21
There also seems to be unexpected whitespace in the data 

Aamir Khan:
20111030 19:43:51
Explanation of test cases please. For 1 element sequences {231},{19},{7},{19} all are valid ?


:D:
20111001 13:52:42
Please remember that the problem requires heavy optimization. You pretty much will need fast input reading and efficient O(N) algo. 

:D:
20100531 06:26:58
There are 0 values in the sequence. 
Added by:  Pripoae Toni 
Date:  20080929 
Time limit:  0.100s0.284s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO 
Resource:  Mircea Pasoi 