{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eButt-head has n volumes of his favourite Encyclopedia For Stupid Teenagers. The volumes are numbered from \u003cstrong\u003e1\u003c/strong\u003e to \u003cstrong\u003en\u003c/strong\u003e and arranged in a row. He doesn’t like strict order, but he dislikes complete chaos as well. Butt-head counts the \u003cem\u003edistance\u003c/em\u003e of volumes’ pertmutation as the sum of differences between number and position for all volumes. In other words, if the permutation is (\u003cstrong\u003ei_1\u003c/strong\u003e, \u003cstrong\u003ei_2\u003c/strong\u003e, ... \u003cstrong\u003ei_n\u003c/strong\u003e), where \u003cstrong\u003ei_k\u003c/strong\u003e (1 ≤ \u003cstrong\u003ek\u003c/strong\u003e ≤ \u003cstrong\u003en\u003c/strong\u003e) denotes the number of volume on \u003cstrong\u003ek\u003c/strong\u003e-th place, then its distance will be |\u003cstrong\u003ei_1\u003c/strong\u003e--1|+|\u003cstrong\u003ei_2\u003c/strong\u003e--2|+...+|\u003cstrong\u003ei_n\u003c/strong\u003e--\u003cstrong\u003en\u003c/strong\u003e|. Butt-head has a favourite number \u003cstrong\u003ed\u003c/strong\u003e, and he wants to arrange the Encyclopedia volumes so, that the distance will be equal to \u003cstrong\u003ed\u003c/strong\u003e. In how many ways can he do this?\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eInput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eFirst line of input contains the quantity of tests \u003cstrong\u003eT\u003c/strong\u003e (\u003cstrong\u003e1\u003c/strong\u003e ≤ \u003cstrong\u003eT\u003c/strong\u003e ≤ \u003cstrong\u003e100\u003c/strong\u003e). Each of the next \u003cstrong\u003eT\u003c/strong\u003e lines contains data for one test: the quantity of volumes \u003cstrong\u003en\u003c/strong\u003e (\u003cstrong\u003e1\u003c/strong\u003e ≤ \u003cstrong\u003en\u003c/strong\u003e ≤ \u003cstrong\u003e50\u003c/strong\u003e) and the required distance \u003cstrong\u003ed\u003c/strong\u003e (\u003cstrong\u003e0\u003c/strong\u003e ≤ \u003cstrong\u003ed\u003c/strong\u003e ≤ \u003cstrong\u003e10000\u003c/strong\u003e), separated by a space. Numbers \u003cstrong\u003en\u003c/strong\u003e, \u003cstrong\u003ed\u003c/strong\u003e are integer.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eOutput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eOutput \u003cstrong\u003eT\u003c/strong\u003e lines of the form \"\u003cstrong\u003eCase\u003c/strong\u003e #\u003cstrong\u003eA\u003c/strong\u003e: \u003cstrong\u003eB\u003c/strong\u003e\", where \u003cstrong\u003eA\u003c/strong\u003e is the number of test (beginning from \u003cstrong\u003e1\u003c/strong\u003e), \u003cstrong\u003eB\u003c/strong\u003e is the quantity of permutations of \u003cstrong\u003en\u003c/strong\u003e volumes with distance \u003cstrong\u003ed\u003c/strong\u003e, taken modulo \u003cstrong\u003e100007\u003c/strong\u003e.\u003c/p\u003e\n\n"}},{"title":"Example","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\u003e5\n2 0\n2 2\n4 1\n4 2\n4 6\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: 1\nCase #2: 1\nCase #3: 0\nCase #4: 3\nCase #5: 9\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}