406070: GYM102254 C Coach

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Coachtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Navarro, the main coach of the IME++ students, wants to choose a team for a contest, but the team must obey certain specifications.

Knowing that each student has a certain programming skill and that a team consists of at least $$$1$$$ student, Navarro wants the team to have a skill value (the sum of the team's skill) of at least $$$x$$$ and the difference between the best and the worst skill of the team should be at most $$$d$$$.

Navarro is too busy helping Caio to go well in contests and asks you to find the number of teams that can be formed under the specifications above.

Two teams are considered different if at least one of the members differ.

Input

First line contains three integers $$$n$$$ ($$$1 \le n \le 15$$$), $$$x$$$ ($$$0 \le x \le 10^9 $$$) and $$$d$$$ ($$$0 \le d \le 10^9$$$) — the number of students, the minimum value of skill and the maximum difference between the best and worst skills.

Second line contains $$$n$$$ space-separated integers $$$s_i$$$, where $$$s_i$$$ ($$$0 \le s_i \le 10^9$$$) indicates the skill of the $$$i$$$-th student.

Output

Print the number of teams that can be formed under Navarro's specifications.

ExamplesInput
1 7 50
8
Output
1
Input
5 17 5
10 34 23 57 64
Output
4

加入题单

上一题 下一题 算法标签: