Plant Growth Calculation
Plant Growth Calculation In a matrix containing R rows and C columns, various plants are planted. The growth of a given plant in a calendar month depends on it's current height at the beginning of the month. If the current height is a prime number, the height by which the plant grows in that month is equal to the current height minus previous prime number (If there is no previous prime number consider the previous prime number as zero). If the current height is not a prime number then the height by which the plant grows in that month is equal to the sum of the unit digits of the adjacent plants height at the beginning of the month (If there is no adjacent plant to left or right consider the value as zero). Given the current height of the plants at the beginning of first month, print the height of the plants after N months. Input Format: The first line contains R and C separated by a space. Next R lines contains C values representing the height of the plants (with the values ...