the store sell n item price ith item p_i the store management go hold promotion customer purchase x item y cheap freethe management decide exact value x y therefore ask process q query give value x y determine maximum total value item receive free customer make purchasenote query independent do not affect store stock