http://noi.openjudge.cn/english/18/
There are N kinds of coins. Each kind of coins has a value V and a weight W. Tony wants to go traveling. Unfortunately, he can only carry coins of which the total weight is not greater than K. How much total value of coins can he carry at most?
输入
First line: two positive integers N (N <= 100) and K (K <= 1000).
Next N lines: the i-th line two positive integers V and W (V,W <= 1000) indicating the value and the weight of the i-th coin.
输出
One integer indicating the total value of coins at most.
硬币
描述:
有N种硬币,每种硬币具有价值V及重量W。Tony想要旅游,不幸的是他只能携带总重量不超过K的硬币,他最多能携带价值多少的硬币?
输入:
第一行:两个正整数N和K(N <= 100)(K < = 1000)
接下来N行:第i行包含2个正整数V,W(V,W<= 1000),表示第i行硬币的价值与重量输出:
一个整数表示总最大价值