memoized recursive method to return maximum weight with K as ratio of weight and values
int maxWeightRec ( int wt [ ] , int val [ ] , int K , map < pair < int , int > , int > & mp , int last , int diff ) {