{"task": {"agent_timeout": 600, "task": "1133", "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]\nBessie is a busy computer science graduate student. However, even graduate\nstudents need friends. As a result, Farmer John has opened a pasture with the\nexplicit purpose of helping Bessie and other cows form lasting friendships.\n\nFarmer John's pasture can be regarded as a large 2D grid of square \"cells\"\n(picture a huge chess board). Each cell is labeled with:\n\nC if the cell contains a cow.G if the cell contains grass.. if the cell contains neither a cow nor grass.\nFor two distinct cows to become friends, the cows must choose to meet at  a\ngrass-covered square that is directly horizontally or vertically adjacent  to\nboth of them.  During the process, they eat the grass in the grass-covered\nsquare, so future pairs of cows cannot use that square as a meeting point. The\nsame cow may become friends with more than one other cow,  but no pair of cows\nmay meet and become friends more than once.\n\nFarmer John is hoping that numerous pairs of cows will meet and become friends\nover time.  Please determine the maximum number of new friendships between\ndistinct pairs of cows that can possibly be created by the end of this\nexperience.\n\nINPUT FORMAT (input arrives from the terminal / stdin):\nThe first line contains $N$ and $M$ ($N,M \\leq 1000$).\n\nThe next $N$ lines each contain a string of $M$ characters, describing the pasture.\n\nOUTPUT FORMAT (print output to the terminal / stdout):\nCount the maximum number of pairs of cows that can become friends by the end\nof the experience.\n\nSAMPLE INPUT:\n4 5\n.CGGC\n.CGCG\nCGCG.\n.CC.C\nSAMPLE OUTPUT: \n4\n\nIf we label the cow in row $i$ and column $j$ with coordinates $(i,j)$, then in\nthis example there are cows at $(1,2)$, $(1,5)$, $(2,2)$, $(2,4)$, $(3,1)$, $(3,3)$, $(4,2)$,\n$(4,3)$, and $(4,5)$. One way for four pairs of cows to become friends is as\nfollows:\n\nThe cows at $(2,2)$ and $(3,3)$ eat the grass at $(3,2)$.The cows at $(2,2)$ and $(2,4)$ eat the grass at $(2,3)$.The cows at $(2,4)$ and $(3,3)$ eat the grass at $(3,4)$.The cows at $(2,4)$ and $(1,5)$ eat the grass at $(2,5)$.\nSCORING:\nTest cases 2-4 satisfy $N=2$.Test cases 5-12 satisfy no additional constraints.\n\n\nProblem credits: Benjamin Qi\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": []}