Ensure that you are logged in and have the required permissions to access the test.
There is fence which consists of n wooden blocks with each block having a number written on it represented by an array a. The painter is also given two numbers l and r . He is given the task to paint the fence using at most n colors. But there are certain conditions which the painter must follow while painting:
The painter wants to know in how many ways can he paint the fence.Since the answer can be large, find the answer modulo 1000000007.
Input Format
First line contains 3 space separated denoting the values of n, l and r (1≤n≤105,1≤l≤r≤1012),
Next line contains n space separated integers denoting the values of array a (1≤a[i]≤r).
Output Format
Print the answer in a single line.
The ways of painting are:
{(3),(5),(1,2),(6)} -> Painting 1st block with 1st color,2nd with 2nd, 3rd and 4th with 3rd and 4th block with 4th color.
{(3,5),(1,2),(6)}, {(3),(5),(1,2,6)}, {(3,5),(1,2,6)}, {(3),(5,1),(2,6)}, {(3,5,1),(2),(6)}, {(3,5,1),(2,6)}, {(3,5,1,2),(6)}