{"task": {"agent_timeout": 600, "task": "90", "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 3: Tile Exchanging [Ray Li]\n\nFarmer John wants to remodel the floor of his barn using a collection of\nsquare tiles he recently purchased from the local square mart store (which\nof course, only sells square objects).  Unfortunately, he didn't measure\nthe size of the barn properly before making his purchase, so now he needs\nto exchange some of his tiles for new square tiles of different sizes.\n\nThe N square tiles previously purchased by FJ have side lengths A_1...A_N.\nHe would like to exchange some of these with new square tiles so that the\ntotal sum of the areas of the his tiles is exactly M.  Square mart is\ncurrently offering a special deal: a tile of side length A_i can be\nexchanged for a new tile of side length B_i for a cost of \n|A_i-B_i|*|A_i-B_i| units. However, this deal only applies to\npreviously-purchased tiles -- FJ is not allowed to exchange a tile that he\nhas already obtained via exchanging some other tile (i.e., a size-3 tile\ncannot be exchanged for a size-2 tile, which is then exchanged for a size-1\ntile). \n\nPlease determine the minimum amount of money required to exchange tiles so\nthat the sum of the areas of the tiles becomes M.  Output -1 if it is\nimpossible to obtain an area of M.\n\nPROBLEM NAME: tilechng\n\nINPUT FORMAT:\n\n* Line 1: Two space-separated integers, N (1<=N<=10) and M\n        (1<=M<=10,000).\n\n* Lines 2..1+N: Each line contains one of the integers A_1 through\n        A_N, describing the side length of an input square\n        (1<=A_i<=100).\n\nSAMPLE INPUT:\n\n3 6\n3\n3\n1\n\nINPUT DETAILS:\n\nThere are 3 tiles.  Two are squares of side length 3, and one is a square\nwith side length 1.  We would like to exchange these to make a total area of 6.\n\nOUTPUT FORMAT:\n\n* Line 1: The minimum cost of exchanging tiles to obtain M units of\n        total area, or -1 if this is impossible.\n\nSAMPLE OUTPUT:\n\n5\n\nOUTPUT DETAILS:\n\nExchange one of the side-3 squares for a side-2 square, and another side-3\nsquare for a side-1 square.  This gives the desired area of 4+1+1=6 and\ncosts 4+1=5 units.\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": []}