{"task": {"agent_timeout": 600, "task": "1037", "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]\nFarmer John is worried for the health of his cows (conveniently numbered\n$1 \\ldots N$ as always) after an outbreak of the  highly contagious bovine\ndisease COWVID-19.  \n\nRecently, Farmer John tested all of his cows and found some of them to be \npositive for the disease.  Using video footage from inside his barn, he is able\nto review recent interactions between pairs of cows --- it turns out that when\ncows greet each-other, they shake hooves, a gesture that can unfortunately\nspread the infection from one cow to another.  Farmer John assembles a\ntime-stamped list of interacting pairs of cows, with entries of the form\n$(t, x, y)$, meaning that at time $t$, cow $x$ shook hooves with cow $y$. \nFarmer John also knows the following:\n\n(i) Exactly one cow on his farm could have started out carrying the disease\n(we'll call this cow \"patient zero\").\n\n(ii) Once a cow is infected, she passes the infection along with her next $K$\nhoof shakes (possibly including the same partner cow several times).  After \nshaking hooves $K$ times, she no longer passes the infection along with \nsubsequent hoof shakes (since at this point she realizes she is spreading the\ninfection and washes her hooves carefully).\n\n(iii) Once a cow is infected, she stays infected.\n\nUnfortunately, Farmer John doesn't know which of his $N$ cows is patient zero,\nnor does he know the value of $K$!  Please help him narrow down the\npossibilities for these unknowns based on his data. It is guaranteed that at\nleast one possibility is valid.\n\nINPUT FORMAT:\nThe first line of the input file contains $N$ ($2 \\leq N \\leq 100$) and $T$\n($1 \\leq T \\leq 250$).  The next line contains a string of length $N$ whose\nentries are 0s and 1s,  describing the current state of Farmer John's $N$ cows\n--- 0 represents a healthy cow and 1 represents a cow presently with the\ndisease.  Each of the next $T$ lines describes a record in Farmer John's list of\ninteractions and consists of three integers $t$, $x$, and $y$, where $t$ is a\npositive integer time of the interaction ($t \\leq 250$) and $x$ and $y$ are\ndistinct integers in the range $1 \\ldots N$, indicating which cows shook hands\nat time $t$. At most one interaction happens at each point in time. \n\nOUTPUT FORMAT:\nPrint a single line with three integers $x$, $y$, and $z$, where $x$ is the\nnumber of possible cows who could have been patient zero, $y$ is the smallest\npossible value of $K$ consistent with the data, and $z$ is the largest possible\nvalue of $K$ consistent with the data (if there is no upper bound on $K$ that\ncan be deduced from the data, print \"Infinity\" for $z$). Note that it might be\npossible to have $K=0$.\n\nSAMPLE INPUT:\n4 3\n1100\n7 1 2\n5 2 3\n6 2 4\nSAMPLE OUTPUT: \n1 1 Infinity\n\nThe only candidate for patient zero is cow 1. For all $K>0$, cow 1 infects cow 2\nat time 7, while cows 3 and 4 remain uninfected.\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": []}