1131: 搭配购买
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:7
Solved:6
Description
不允许普通用户打印题目,请教师登录后使用。如有疑问请联系管理员!
Input
第1行n,m,w表示n朵云,m个搭配,Joe有w的钱。
第2至n+1行,每行ci,di表示i朵云的价钱和价值。
第n+2至n+1+m行,每行ui、vi表示买ui必须买vi,同理,如果买vi就必须买ui。
n<=10000;0<=m<=5000;w<=10000;
Output
一行,表示可以获得的最大价值
Sample Input Copy
5 3 10
3 10
3 10
3 10
5 100
10 1
1 3
3 2
4 2
Sample Output Copy
1