{"task": {"agent_timeout": 600, "task": "278", "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]\nProblem 1: Bovine Ballet [Brian Dean, 2013]\n\nIn an attempt to challenge the stereotypical perception of cows as awkward\ncreatures, Farmer John's prize cow Bessie has signed up for an introductory\nballet class.  Her final performance is next week, and FJ wants to help her\nby building a rectangular stage large enough so that she can perform her\nentire dance without falling off the edges.\n\nBessie's dance will take place on a rectangular stage consisting of a grid\nof 1 x 1 square cells.  Bessie's four feet are described concisely as follows:\n\nFR: Front right foot\nFL: Front left foot\nRR: Rear right foot\nRL: Rear left foot\n\nHer four feet start out in 4 adjacent cells forming a square as follows,\nwith Bessie facing north.\n\nFL FR\nRL RR\n\nBessie's dance follows a series of N instructions (1 <= N <= 1000), where\neach instruction tells her to either move one foot by one cell or to pivot\n90 degrees clockwise.  \n\nInstructions to move a foot consist of 3 characters, the first two\nidentifying the foot to move, and the final character specifying the\ndirection of movement (F = forward, B = back, R = right, L = left).  For\nexample, \"FRF\" means Bessie should move her front right foot forward one\ncell, and \"RLR\" means she should move her rear left foot right one cell. \nOf course, the direction of movement is relative to the direction Bessie is\nfacing.\n\nInstruction to pivot are also 3 characters, the first two specifying the\nsingle foot that Bessie keeps planted, around which she rotates 90 degrees\nclockwise.  The last character is \"P\" (for pivot).  For example, the\ninstruction \"FRP\" means Bessie should pivot 90 degrees clockwise about her\nstationary front right foot.  This means that if her feet are currently\nsituated as follows (with Bessie facing north)\n\n.. .. .. \n.. .. FR \n.. FL .. \n.. RL RR \n\nthen the after the instruction \"FRP\" her feet will be located as follows,\nwith Bessie now facing east:\n\nRL FL .. \nRR .. FR \n.. .. ..  \n.. .. .. \n\nGiven the N instructions in Bessie's dance, please compute the minimum area\nof a rectangular stage necessary contain her feet during the entire dance.\n\nIf Bessie clumsily ever moves one foot onto the same cell as another foot,\nshe will trip and fail to complete the dance; in this case, please output\n-1.  Note that this is the only case where Bessie will trip; she has become\nquite flexible after all her practice, and can easily move her feet into\nrather strange configurations (for example, with her back feet farther\nforward than her front feet).\n\nPROBLEM NAME: ballet\n\nINPUT FORMAT:\n\n* Line 1: The integer N.\n\n* Lines 2..1+N: Each line contains one of the 3-character instructions\n        in Bessie's dance.\n\nSAMPLE INPUT:\n\n3\nFRF\nFRP\nRLB\n\nINPUT DETAILS:\n\nBessie's dance consists of the instructions \"front right foot forward\",\n\"front right foot pivot\", and \"rear left foot back\".\n\nOUTPUT FORMAT:\n\n* Line 1: The minimum area of a rectangular stage necessary to contain\n        Bessie's feet during the entire dance, or -1 if Bessie trips.\n\nSAMPLE OUTPUT:\n\n16\n\nOUTPUT DETAILS:\n\nBessie needs a 4 x 4 stage to complete her dance.  Her feet move as follows:\n\n.. .. .. .. \n.. .. .. .. (facing north)\n.. .. FL FR \n.. .. RL RR \n\nAfter FRF:\n\n.. .. .. .. \n.. .. .. FR (facing north)\n.. .. FL .. \n.. .. RL RR \n\nAfter FRP:\n\n.. RL FL .. \n.. RR .. FR (facing east)\n.. .. .. .. \n.. .. .. .. \n\nAfter RLB:\n\nRL .. FL ..\n.. RR .. FR (facing east)\n.. .. .. ..\n.. .. .. ..\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": []}