PROGRAMMING:Image filtering
This question comes from the pat (basic level) practice.
Image filtering is to dye the unimportant pixels in the image into the background color, so that the important parts are highlighted. Now, given a black-and-white image, you are required to replace all the pixels whose gray value is in a specified range with a specified color.
###Input format:
Input the resolution of an image in the first line, i.e. two positive integers m and n (0 < m, n ≤ 500), the end points a and B (0 ≤ a < B ≤ 255) of the gray value interval to be filtered, and the specified replacement gray value. Then m lines, each line gives the gray value of N pixels, separated by spaces. All gray values are in the range of [0, 255].
###Output format:
Output the required filtered image. That is, output m lines, N pixel gray values in each line, each gray value occupies 3 bits (for example, black should be displayed as 000), separated by a space. There must be no extra spaces at the beginning and end of the line.
###Input example:
Here is a set of inputs. For example:
```in
3 5 100 150 0
3 189 254 101 119
150 233 151 99 100
88 123 149 0 255
```
###Output example:
The corresponding output is given here. For example:
```out
003 189 254 000 000
000 233 151 099 000
088 000 000 000 255
```
answer:If there is no answer, please comment
Image filtering is to dye the unimportant pixels in the image into the background color, so that the important parts are highlighted. Now, given a black-and-white image, you are required to replace all the pixels whose gray value is in a specified range with a specified color.
###Input format:
Input the resolution of an image in the first line, i.e. two positive integers m and n (0 < m, n ≤ 500), the end points a and B (0 ≤ a < B ≤ 255) of the gray value interval to be filtered, and the specified replacement gray value. Then m lines, each line gives the gray value of N pixels, separated by spaces. All gray values are in the range of [0, 255].
###Output format:
Output the required filtered image. That is, output m lines, N pixel gray values in each line, each gray value occupies 3 bits (for example, black should be displayed as 000), separated by a space. There must be no extra spaces at the beginning and end of the line.
###Input example:
Here is a set of inputs. For example:
```in
3 5 100 150 0
3 189 254 101 119
150 233 151 99 100
88 123 149 0 255
```
###Output example:
The corresponding output is given here. For example:
```out
003 189 254 000 000
000 233 151 099 000
088 000 000 000 255
```
answer:If there is no answer, please comment