3091 - Harry Potter vs Warlocks 3091 - Harry Potter vs Warlocks 3091 - Harry Potter vs Warlocks

Statistics Sub: 356 | AC: 83 | AC%: 23,31 | Score: 2,02
Created by Rubén Alcolea Núñez
Added by ralcolea (2015-01-15)
Limits
Total Time: 12000 MS | Test Time: 1000 MS |Memory: 123 MB | Output: 64 MB | Size: 14 KB
Enabled languages
Available in

Description

Harry Potter has learned a lot about magic and spells in the School of Hogwarts and now he wants to knows how good he is. He should face a hard test to know that. He has to fight against a group of (1 ≤ N ≤ 34) powerful Warlocks. Harry has a power of attack that is defined as (0 ≤ P ≤ 10^9) and it depends on the experience and skills that Harry has. Each enemy warlock has a certain power (1 ≤ Pi ≤ 10^9) that describes the amount of power that Harry needs to defeat the ith warlock. Harry wants to know the number of different sets of Warlocks that he is able to defeat. Two sets of Warlocks are considered different if there is at least one Warlock which is included in one set and not included in the other. Harry is a wizard very fast and intelligent, that's why he is able to defeat a set of Warlocks if his power of attack is not less than the sum of the powers of the Warlocks in the set. Harry is only interested in sets of Warlocks with at least one Warlock. Help Harry to determine the number of different sets of Warlocks he can defeat with his current skills.
Harry Potter has learned a lot about magic and spells in the School of Hogwarts and now he wants to knows how good he is. He should face a hard test to know that. He has to fight against a group of (1 ≤ N ≤ 34) powerful Warlocks. Harry has a power of attack that is defined as (0 ≤ P ≤ 10^9) and it depends on the experience and skills that Harry has. Each enemy warlock has a certain power (1 ≤ Pi ≤ 10^9) that describes the amount of power that Harry needs to defeat the ith warlock. Harry wants to know the number of different sets of Warlocks that he is able to defeat. Two sets of Warlocks are considered different if there is at least one Warlock which is included in one set and not included in the other. Harry is a wizard very fast and intelligent, that's why he is able to defeat a set of Warlocks if his power of attack is not less than the sum of the powers of the Warlocks in the set. Harry is only interested in sets of Warlocks with at least one Warlock. Help Harry to determine the number of different sets of Warlocks he can defeat with his current skills.
Harry Potter has learned a lot about magic and spells in the School of Hogwarts and now he wants to knows how good he is. He should face a hard test to know that. He has to fight against a group of (1 ≤ N ≤ 34) powerful Warlocks. Harry has a power of attack that is defined as (0 ≤ P ≤ 10^9) and it depends on the experience and skills that Harry has. Each enemy warlock has a certain power (1 ≤ Pi ≤ 10^9) that describes the amount of power that Harry needs to defeat the ith warlock. Harry wants to know the number of different sets of Warlocks that he is able to defeat. Two sets of Warlocks are considered different if there is at least one Warlock which is included in one set and not included in the other. Harry is a wizard very fast and intelligent, that's why he is able to defeat a set of Warlocks if his power of attack is not less than the sum of the powers of the Warlocks in the set. Harry is only interested in sets of Warlocks with at least one Warlock. Help Harry to determine the number of different sets of Warlocks he can defeat with his current skills.

Input specification

The first line of the input has two integers N and P separated by a whitespace, indicating the numbers of Warlocks that will fight against Harry and the power of attack of Harry. The second line contains N integers separated by a whitespace. Each integer Pi describes the power of the ith Warlock.
The first line of the input has two integers N and P separated by a whitespace, indicating the numbers of Warlocks that will fight against Harry and the power of attack of Harry. The second line contains N integers separated by a whitespace. Each integer Pi describes the power of the ith Warlock.
The first line of the input has two integers N and P separated by a whitespace, indicating the numbers of Warlocks that will fight against Harry and the power of attack of Harry. The second line contains N integers separated by a whitespace. Each integer Pi describes the power of the ith Warlock.

Output specification

The output should contain an integer specifying the number of different sets of Warlocks that Harry is able to defeat.
The output should contain an integer specifying the number of different sets of Warlocks that Harry is able to defeat.
The first line of the input has two integers N and P separated by a whitespace, indicating the numbers of Warlocks that will fight against Harry and the power of attack of Harry. The second line contains N integers separated by a whitespace. Each integer Pi describes the power of the ith Warlock.

Sample input

4 10
5 4 2 11

Sample output

6

Hint(s)

The six sets of Warlocks that Harry can defeat are described below:
{2}, {4}, {5}, {2, 4}, {2, 5}, {4, 5}
The six sets of Warlocks that Harry can defeat are described below:
{2}, {4}, {5}, {2, 4}, {2, 5}, {4, 5}
The six sets of Warlocks that Harry can defeat are described below:
{2}, {4}, {5}, {2, 4}, {2, 5}, {4, 5}

Recommendation

We have carefully selected several similar problems: 3675 | 3377 | 3166 | 3515 | 1005 | 1960