Oggy And The Cockroaches
All submissions for this problem are available.
In the cartoon series “Oggy and the Cockroaches”. The Roaches Joey, Dee Dee and Marky are again building up a plan to make Oggy’s life miserable. They have called all their cockroach friends to help them. Oggy realizes this and now is making a counter plan for killing the roaches. You are a meticulous pest control agent Oggy just hired. You have to help him track all the cockroaches!! Oggy made a map of his square kitchen and divided it into tiles. On every tile sits some known number of cockroaches. You have a square trap that is dropped to cover a certain number of tiles. The trap may only cover tiles from within the map. However, the trap only catches cockroaches from one of the tiles which it has covered, having a minimum number of cockroaches on it. For all possible positions at which the trap can be dropped, determine number of cockroaches that will be caught.
Two numbers, m which is the size of the map, and t which is size of the trap, followed by m rows with f numbers, determining the number of cockroaches on each tile.
You should output m-t+1 rows with m-t+1 numbers in each row.
- 0 < m ≤ 1000
- 0 < t ≤ m
Input: 4 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 0 Output: 0 1 2 4 0 0 2 0 0
|Time Limit:||0.118497 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions