(int i, int cb, int t, int ww)
| 7 | static int c[]; |
| 8 | |
| 9 | public static int func (int i, int cb, int t, int ww) |
| 10 | { |
| 11 | if (i == n) |
| 12 | { |
| 13 | if ((cb & 1) != 0) |
| 14 | return 0; |
| 15 | else |
| 16 | return t; |
| 17 | } |
| 18 | if (ww + b[i] <= w) |
| 19 | return Math.max (func (i + 1, cb + c[i], t + a[i], ww + b[i]),func (i + 1, cb, t, ww)); |
| 20 | return func (i + 1, cb, t, ww); |
| 21 | } |
| 22 | |
| 23 | public static void main (String[]args) |
| 24 | { |