knap: val/wt[j] corresponds to K[j][]