Posts

Showing posts from April 18, 2021

Colorful Flowers Count

Image
 Colorful Flowers Count  PROBLEM STATEMENT : In a garden, there are N flower plants in a row. There are three types of plants which are given below.  Type 1: It gives only a red flower every day.  Type 2: It gives only a green flower every 2 days.  Type 3: It gives only a blue flower every 3 days.  Initially, there are no flowers in the N plants. The program must accept N characters denoting the colors of the N plants and N integers denoting the maximum number of flowers that the plants can give. The program must print the total number of flowers in each color that the gardener can get in T days. The value of T is also passed as the input.  Boundary Condition(s):  1 <= N <= 100  1 <= Each integer value <= 1000  2 <= T <= 1000  Input Format:  The first line contains N.  The second line contains N characters separated by a space.  The third line contains N integer values separated by a space....