{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"After graduating in CS, Mr \u0027AcmHateKori\u0027 has opened a cyber caf\u0026#233;. His business was running quite well unless one day he faced a problem, and with his non-ACM mind he was unable to solve that.\n\nIn his caf\u0026#233; he maintains two papers for his customers. One paper contains the entering times of the customers in the caf\u0026#233; and the other paper contains the times they have exited. He writes the times in the same order in the papers for the money calculations. And he only writes the nearest minute of the time. He writes the times from **0** to **1000** (0 means 12:00 am, 60 means 01:00 am, 730 means 02:10 pm). This idea was given by his little son.\n\nWhen a person exits the caf\u0026#233; he was to pay some money. If he stays in the caf\u0026#233; for **T** minutes, he has to pay **(T-K)\u003csup\u003e2\u003c/sup\u003e** paisa but not more than **G** paisa (if money exceeds **G**). It\u0027s guaranteed that every person stays at least one minute in the caf\u0026#233;.\n\nNow one day his little son came to the caf\u0026#233; and took the paper that contained the entering times of the customers. He took a new paper and wrote the entering times randomly and threw the old paper. When his father came, he found two papers, where the first one contained some random entering times. He was at a loss and angry. Cause how can he find the total money given by the customers since for an entering time there can be multiple exiting times.\n\nSo, finally he realized the importance of ACM in life and asked you to find the minimum and maximum money he could earn by matching all entering times and exiting times. His son can be faulty. So, you have to report that too."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026#8804; 100)**, denoting the number of test cases.\n\nEach case starts with a line containing three integers **n (1 \u0026#8804; n \u0026#8804; 50), K (1 \u0026#8804; K \u0026#8804; 1000), G (0 \u0026#8804; G \u0026#8804; 10000)** where **n** denotes the number of customers. The next line contains **n** space separated integers denoting the entering times of the customers. The next line contains **n** space separated integers denoting the exiting times of the customers. All the given times will lie in the range **[0, 1000]**."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number, the minimum and maximum money he could earn or `impossible` if his son had made some mistakes."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n3 7 11\n8 9 10\n9 11 20\n2 10 10\n1 11\n2 9\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 31 33\nCase 2: impossible\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}