atcoder#ARC060A. [ABC044C] 高橋君とカード
[ABC044C] 高橋君とカード
Score : points
Problem Statement
Tak has cards. On the -th card is written an integer . He is selecting one or more cards from these cards, so that the average of the integers written on the selected cards is exactly . In how many ways can he make his selection?
Constraints
- are integers.
Partial Score
- points will be awarded for passing the test set satisfying .
Input
The input is given from Standard Input in the following format:
Output
Print the number of ways to select cards such that the average of the written integers is exactly .
4 8
7 9 8 9
5
- The following are the ways to select cards such that the average is :- Select the -rd card.
- Select the -st and -nd cards.
- Select the -st and -th cards.
- Select the -st, -nd and -rd cards.
- Select the -st, -rd and -th cards.
3 8
6 6 9
0
8 5
3 6 2 8 7 6 5 9
19
33 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
8589934591
- The answer may not fit into a -bit integer.