Company: Tally_14march
Difficulty: medium
Nature Walk Problem Description You are tending a row of thirsty plants along a trail during an outing. Each plant needs a certain amount of water, and you can only pour from a container you are carrying — once that container runs dry, or doesn't hold enough for the next plant, you must walk back to the river and refill before continuing. The location of plants is given as an array (0-based indexed), and the array elements denote the amount of water a plant requires. The river is at -1, index position. You have to calculate the number of steps required to water all the plants. Note: You start from the river i.e., the index position -1. Input Format An integer N , giving how many plants sit along the trail, N further lines, each holding the amount of water one plant needs, in trail order. A final line giving K , how much water the container holds when full. Constraints N : the size of the array. 1 N 3 . a[i] : the array elements. 1 a[i] 6 . K : the capacity of the container. max( a[i] )