Help:=proc(): print(`ExonC(S,n) `): end: #ExonC(S,n): the best collection of jobs ending #at day n (drawn from S) ExonC:=proc(S,n) local v,champ,rec,tem,S1,cand,try1: option remember: if n=0 then RETURN({},0): fi: tem:=ExonC(S,n-1): champ:=tem[1]: rec:=tem[2]: S1:={}: for v in (S minus {}) do if v[2]=n then S1:=S1 union {v}: fi: od: for v in S1 do tem:=ExonC(S,v[1]-1): cand:=tem[1] union {v}: try1:=tem[2]+v[3]: if try1>rec then champ:=cand: rec:=try1: fi: od: champ,rec: end: