Problem E: 背包问题

Problem E: 背包问题

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 17  Solved: 6
[Submit] [Status] [Web Board] [Creator:]

Description

简单的背包问题。设有一个背包,可以放入的重量为 s。现有 n 件物品,重量分别为 w1,w2…,wn,(1≤i≤n)均为正整数,从 n 件物品中挑选若干件,使得放入背包的重量之和正好为 s。找到一组解即可。

Input

第一行是物品总件数和背包的载重量,第二行为各物品的重量。

Output

各所选物品的序号和重量。
如果没有找到,则输出“not found”。

Sample Input Copy

5 10 
1 2 3 4 5

Sample Output Copy

number:1 weight:1 
number:4 weight:4 
number:5 weight:5