Monica wants to buy exactly one keyboard and one USB drive from her favorite electronics store. The store sells n different brands of keyboards and n different brands of USB drives. Monica has exactly dollars to spend, and she wants to spend as much of it as possible (i.e., the total cost of her purchase must be maximal).
Given the price lists for the store's keyboards and USB drives, find and print the amount money Monica will spend. If she doesn't have enough money to buy one keyboard and one USB drive, print -1 instead.
Note: She will never buy more than one keyboard and one USB drive even if she has the leftover money to do so.
Input Format
The first line contains three space-separated integers describing the respective values of s (the amount of money Monica has), n (the number of keyboard brands) and m (the number of USB drive brands).
The second line contains space-separated integers denoting the prices of each keyboard brand.
The third line contains space-separated integers denoting the prices of each USB drive brand.
Auf dieser Seite können Sie das Online-Video Electronics Shop mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Shital Luitel 01 Januar 1970 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 65 Mal angesehen und es wurde von 1 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!