eBayOA #3
Image Blur
Estimated EasyJudge-ready
Topics (AI-labelled)SimulationPrefix & Ranges
For each center pixel whose window lies completely inside the image, take the mean of the square window centered on it whose row and column offsets do not exceed radius, rounded down. A pixel whose window is incomplete at the boundary keeps its original value, and all windows are based on the original image.
Input
h,w (1..500, hw≤250000), radius (0..500), followed by the pixel matrix; pixels are 0..255. The ranges are site supplements.
Output
Output the pixel matrix as h rows.
Example 1
Input:
3 3 1
0 0 1
0 1 1
0 1 0
Output:
0 0 1
0 0 1
0 1 0
Example 2
Input:
1 1 0
7
Output:
7
Example 3
Input:
2 4 1
1 9 3 4
5 2 8 6
Output:
1 9 3 4
5 2 8 6
Editorial
Loading solution…