{"task": {"agent_timeout": 600, "task": "860", "verifier_timeout": 7200, "instruction": "Please implement a Python 3 solution to the below problem.\nReason through the problem and:\n1. Restate the problem in plain English\n2. Conceptualize a solution first in plain English\n3. Write a pseudocode solution\n4. Save your solution as solution.py\nNo outside libraries are allowed.\n\n[BEGIN PROBLEM]\nWith plenty of free time on their hands (or rather, hooves), the cows on Farmer\nJohn's farm often pass the time by playing video games.  One of their favorites\nis based on a popular human video game called Puyo Puyo; the cow version is of\ncourse called Mooyo Mooyo.\n\nThe game of Mooyo Mooyo is played on a tall narrow grid $N$ cells tall\n($1 \\leq N \\leq 100$) and 10 cells wide.  Here is an example with $N = 6$:\n\n\n0000000000\n0000000300\n0054000300\n1054502230\n2211122220\n1111111223\n\nEach cell is either empty (indicated by a 0), or a haybale in one of nine\ndifferent colors (indicated by characters 1..9).  Gravity causes haybales to\nfall downward, so there is never a 0 cell below a haybale.  \n\nTwo cells belong to the same connected region if they are directly adjacent\neither horizontally or vertically, and they have the same nonzero color.  Any\ntime a connected region exists with at least $K$ cells, its haybales all\ndisappear, turning into zeros.  If multiple such connected regions exist at the\nsame time, they all disappear simultaneously.  Afterwards, gravity might cause\nhaybales to fall downward to fill some of the resulting cells that became zeros.\nIn the resulting configuration, there may again be connected regions of size at\nleast $K$ cells.  If so, they also disappear (simultaneously, if there are\nmultiple such regions), then gravity pulls the remaining cells downward, and the\nprocess repeats until no connected regions of size at least $K$ exist.  \n\nGiven the state of a Mooyo Mooyo board, please output a final picture of the\nboard after these operations have occurred.\n\nINPUT FORMAT:\nThe first line of input contains $N$ and $K$ ($1 \\leq K \\leq 10N$). The\nremaining $N$ lines specify the initial state of the board.\n\nOUTPUT FORMAT:\nPlease output $N$ lines, describing a picture of the final board state.\n\nSAMPLE INPUT:\n6 3\n0000000000\n0000000300\n0054000300\n1054502230\n2211122220\n1111111223\nSAMPLE OUTPUT: \n0000000000\n0000000000\n0000000000\n0000000000\n1054000000\n2254500000\n\nIn the example above, if $K = 3$, then there is a connected region of size at\nleast $K$ with color 1 and also one with color 2.  Once these are simultaneously\nremoved, the board temporarily looks like this:\n\n\n0000000000\n0000000300\n0054000300\n1054500030\n2200000000\n0000000003\n\nThen, gravity takes effect and the haybales drop to this configuration:\n\n\n0000000000\n0000000000\n0000000000\n0000000000\n1054000300\n2254500333\n\nAgain, there is a region of size at least $K$ (with color 3).  Removing it\nyields the final board configuration:\n\n\n0000000000\n0000000000\n0000000000\n0000000000\n1054000000\n2254500000\n\n\nProblem credits: Brian Dean\n\n[END PROBLEM]\n", "memory": "2048m", "runnable": false, "difficulty": "medium", "language": "", "cpus": 1, "instruction_truncated": false, "category": "python_programming", "compose": false, "has_solution": true, "oracle": null, "docker_image": "", "taskset": "usaco", "tags": ["python", "programming", "usaco"]}, "runs": []}