#P11703. OI Contest Score Sum
OI Contest Score Sum
OI Contest Score Sum
In an OI contest each problem must contribute some positive score -- no zero scores allowed. In the contest, there are \( n \) problems. The \( i\)-th problem consists of \( k_i \) subtasks, and the \( j\)-th subtask of problem \( i \) awards \( c_{i,j} \) points. The subtasks within a problem are independent, and you may choose an arbitrary non-empty subset of the subtasks to solve for that problem. (You must solve at least one subtask per problem, otherwise you would get 0 points in that problem, which is not allowed.)
Your task is to decide whether it is possible to achieve exactly \( s \) points in total by selecting a non-empty subset of subtasks in each problem.
Input Format:
The first line contains two integers \( n \) and \( s \). Each of the next \( n \) lines begins with an integer \( k_i \) (the number of subtasks for problem \( i \)) followed by \( k_i \) integers \( c_{i,1}, c_{i,2}, \dots, c_{i,k_i} \) representing the points for each subtask.
Output Format:
Print Yes if it is possible to achieve exactly \( s \) points, otherwise print No.
inputFormat
The input consists of multiple lines. The first line contains two positive integers \( n \) and \( s \). The following \( n \) lines each start with an integer \( k_i \) - the number of subtasks in problem \( i \), followed by \( k_i \) space-separated integers \( c_{i,1}, c_{i,2}, \dots, c_{i,k_i} \).
outputFormat
Output a single line containing Yes if it is possible to achieve exactly \( s \) points by selecting at least one subtask from each problem, otherwise output No. The output is case-sensitive.
sample
2 5
2 1 3
2 2 4
Yes
</p>