Mock CCC '19 Contest 1 S4 - Set Division

View as PDF

Submit solution

Points: 15 (partial)
Time limit: 2.0s
Memory limit: 128M

Author:
Problem type

There is a set consisting of N distinct integers. The i^{th} smallest element in this set is S_i. We want to divide this set into two sets, X and Y, such that:

  • The absolute difference of any two distinct elements in X is A or greater.
  • The absolute difference of any two distinct elements in Y is B or greater.

How many ways are there to perform such a division, modulo 10^9+7? Note that X or Y may be empty.

Input Specification

The first line will contain three integers, N, A, B (1 \le N \le 10^5, 1 \le A, B \le 10^9).

The next N lines will each contain one integers, S_i (0 \le S_i \le 10^{15}, S_i < S_{i+1}).

Output Specification

Print the number of different divisions satisfying the conditions, modulo 10^9+7.

Subtasks

For 2/15 of the points, N \le 20.

For an additional 5/15 of the points, N \le 1000.

Sample Input 1

5 3 7
1
3
6
9
12

Sample Output 1

5

Sample Input 2

7 5 3
0
2
4
7
8
11
15

Sample Output 2

4

Sample Input 3

8 2 9
3
4
5
13
15
22
26
32

Sample Output 3

13

Comments

There are no comments at the moment.