There are stalls in a vegetable market that are selling vegetables. You have to buy an equal amount of vegetables from each stall. If a stall does not have enough vegetables to offer, then you have to buy all the vegetables available in that stall. If you are given the number of vegetables that every stall can offer, determine the minimum quantity that you need to buy from each stall such that you have at least vegetables in total.
Input format
Output format
Constraints
Query 1: By taking vegetables from every stall, we get . If we take vegetables, we would get .
Query 2: By taking from each stall, we get .
Query 4: Even if we take all from every shop, we would have . Hence the answer is .