## A Coin Problem

View as PDF

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

Author:
Problem type

Your parents have generously given you $$N$$ types of coins with various denominations. They would like to know if there is some combination of coins that sum up to the value $$S$$.

#### Input Specification

The first line will contain two integers $$N, S\ (1 \le N \le 100, 1 \le S \le 10\ 000)$$.

The second line will contain $$N$$ integers, $$c_1, c_2, \ldots, c_N\ (1 \le c_i \le 1\ 000)$$ the denominations of the coins that your parents will give you. Note that the same denomination of coin may be used multiple times.

#### Output Specification

Print YES if it is possible to use some combination of the coins to sum up to $$S$$, or NO otherwise.

3 6
1 4 5

YES

#### Explanation for Sample 1

We can use $$6$$ coins of value $$1$$ to make the sum of $$S = 6$$. Note that there are other ways as well.

2 11
3 7

NO

#### Explanation for Sample 2

There are no ways to make $$S = 11$$ with coins of value $$3$$ and $$7$$.

2 7
3 2

YES

#### Explanation for Sample 3

We can use $$1$$ coin of value $$3$$ and $$2$$ coins of value $$2$$ to make a total sum of $$7$$.
The text passage describes a problem statement for a programming challenge involving coin denominations and determining if a target sum can be achieved using the given coins. It includes sample inputs and outputs with explanations.
multiple_questions_with_answers
Given a text passage, determine:
    1. If it contains a mathematical question (including word problems or calculations)
    2. If an answer to that mathematical question is provided in the text

First, describe the content structure you found in 1-2 sentences.

Then provide your analysis in the following format:
TYPE: <one of the following values>
- NO_QUESTION
- SINGLE_QUESTION
- SINGLE_QUESTION_WITH_ANSWER
- MULTIPLE_QUESTIONS
- MULTIPLE_QUESTIONS_WITH_ANSWERS
system
## A Coin Problem

View as PDF

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

Author:
Problem type

Your parents have generously given you $$N$$ types of coins with various denominations. They would like to know if there is some combination of coins that sum up to the value $$S$$.

#### Input Specification

The first line will contain two integers $$N, S\ (1 \le N \le 100, 1 \le S \le 10\ 000)$$.

The second line will contain $$N$$ integers, $$c_1, c_2, \ldots, c_N\ (1 \le c_i \le 1\ 000)$$ the denominations of the coins that your parents will give you. Note that the same denomination of coin may be used multiple times.

#### Output Specification

Print YES if it is possible to use some combination of the coins to sum up to $$S$$, or NO otherwise.

3 6
1 4 5

YES

#### Explanation for Sample 1

We can use $$6$$ coins of value $$1$$ to make the sum of $$S = 6$$. Note that there are other ways as well.

2 11
3 7

NO

#### Explanation for Sample 2

There are no ways to make $$S = 11$$ with coins of value $$3$$ and $$7$$.

2 7
3 2

YES

#### Explanation for Sample 3

We can use $$1$$ coin of value $$3$$ and $$2$$ coins of value $$2$$ to make a total sum of $$7$$.
user
The text passage describes a problem statement for a programming challenge involving coin denominations and determining if a target sum can be achieved using the given coins. It includes sample inputs and outputs with explanations.

TYPE: MULTIPLE_QUESTIONS_WITH_ANSWERS