{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"Gigel has a strange \"balance\" and he wants to poise it. Actually, the device is different from any other ordinary balance.\r\u003cbr\u003eIt orders two arms of negligible weight and each arm\u0027s length is 15. Some hooks are attached to these arms and Gigel wants to hang up some weights from his collection of G weights (1 \u0026lt;\u003d G \u0026lt;\u003d 20) knowing that these weights have distinct values in the range 1..25. Gigel may droop any weight of any hook but he is forced to use all the weights.\r\u003cbr\u003eFinally, Gigel managed to balance the device using the experience he gained at the National Olympiad in Informatics. Now he would like to know in how many ways the device can be balanced.\r\u003cbr\u003e\r\u003cbr\u003eKnowing the repartition of the hooks and the set of the weights write a program that calculates the number of possibilities to balance the device.\r\u003cbr\u003eIt is guaranteed that will exist at least one solution for each test case at the evaluation.\r\u003cbr\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input has the following structure:\r\u003cbr\u003e•\tthe first line contains the number C (2 \u0026lt;\u003d C \u0026lt;\u003d 20) and the number G (2 \u0026lt;\u003d G \u0026lt;\u003d 20);\r\u003cbr\u003e•\tthe next line contains C integer numbers (these numbers are also distinct and sorted in ascending order) in the range -15..15 representing the repartition of the hooks; each number represents the position relative to the center of the balance on the X axis (when no weights are attached the device is balanced and lined up to the X axis; the absolute value of the distances represents the distance between the hook and the balance center and the sign of the numbers determines the arm of the balance to which the hook is attached: \u0027-\u0027 for the left arm and \u0027+\u0027 for the right arm); \r\u003cbr\u003e•\ton the next line there are G natural, distinct and sorted in ascending order numbers in the range 1..25 representing the weights\u0027 values. \r\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"The output contains the number M representing the number of possibilities to poise the balance. "}},{"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 4\t\r\n-2 3 \r\n3 4 5 8\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}