#K34017. Image Cropping
Image Cropping
Image Cropping
You are given an image represented as an R × C matrix of characters. Your task is to crop the image based on given top-left indices \(r_1, c_1\) and bottom-right indices \(r_2, c_2\). The indices are 0-based. The cropped image should include every row from \(r_1\) to \(r_2\) (inclusive) and every column from \(c_1\) to \(c_2\) (inclusive).
Formally, given an image matrix \(A\) and integers \(r_1, c_1, r_2, c_2\), output the submatrix \(A[r_1:r_2+1,\ c_1:c_2+1]\).
inputFormat
The input is read from stdin and has the following format:
- The first line contains two integers \(R\) and \(C\), representing the number of rows and columns of the image.
- The next \(R\) lines each contain a string of exactly \(C\) characters, representing the rows of the image.
- The last line contains four integers \(r_1, c_1, r_2, c_2\), which are the indices of the top-left and bottom-right corners of the cropping rectangle.
outputFormat
Print the cropped image onto stdout. Each row of the cropped image should be printed on a new line without spaces between the characters.
## sample4 4
abcd
efgh
ijkl
mnop
1 1 2 2
fg
jk
</p>