Company: Visa_29Aug
Difficulty: medium
Garden Sprinklers Problem Description You are in charge of a large garden with various irrigation sprinklers arranged across different sections. The garden has a water requirement, measured in units of water supply , that you need to meet to keep the plants healthy. You have n sprinklers in the garden. Each sprinkler i can provide w_i units of water before it needs to be refilled . The refill process takes r_i days to complete, during which the sprinkler cannot supply water. On each day, you can use all sprinklers that are not currently being refilled. If all sprinklers are being refilled on a given day, no water is supplied to the garden for that day. Initially, all sprinklers are filled and ready to use. Your task is to calculate the minimum number of days required to meet or exceed the garden's water requirement. Input Format The first line contains two integers W and n (1 ≤ W, n ≤ 20*5) — the total water requirement and the number of sprinklers in the garden. The second