// vege_patch.c // // Written by YOUR-NAME (YOUR-ZID) // on TODAYS-DATE // // Finds the most productive top-left to bottom-right diagonal path // through a vegetable garden. #include // Constants #define MAX_SIZE 10 // Function prototypes int get_best_yield(int garden[MAX_SIZE][MAX_SIZE], int rows, int cols); int main(void) { int garden[MAX_SIZE][MAX_SIZE]; int rows; int cols; printf("Enter the size of the garden: "); scanf("%d %d", &rows, &cols); printf("Enter the yield of each plot:\n"); for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { scanf("%d", &garden[i][j]); } } int best = get_best_yield(garden, rows, cols); printf("The most productive path yields %d kg.\n", best); return 0; } // Return the highest total yield of any top-left to bottom-right // diagonal path through the garden. int get_best_yield(int garden[MAX_SIZE][MAX_SIZE], int rows, int cols) { // TODO: Complete this function return 0; }