{"trustable":false,"sections":[{"title":"","value":{"format":"MD","content":"A rook is a piece used in the game of chess which is played on a board of square grids. A rook can only move vertically or horizontally from its current position and two rooks attack each other if one is on the path of the other.\n\nIn the following figure, the dark squares represent the reachable locations for rook **R\u003csub\u003e1\u003c/sub\u003e** from its current position. The figure also shows that the rook **R\u003csub\u003e1\u003c/sub\u003e** and **R\u003csub\u003e2\u003c/sub\u003e** are in attacking positions where **R\u003csub\u003e1\u003c/sub\u003e** and **R\u003csub\u003e3\u003c/sub\u003e** are not. **R\u003csub\u003e2\u003c/sub\u003e** and **R\u003csub\u003e3\u003c/sub\u003e** are also in non-attacking positions.\n\n![Rooks](CDN_BASE_URL/7350b47cd445513e32619b7f380f53b2?v\u003d1673311236)\n\nNow, given two numbers **n** and **k**, your job is to determine the number of ways one can put **k** rooks on an **n x n** chessboard so that no two of them are in attacking positions."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 350)**, denoting the number of test cases.\n\nEach case contains two integers **n (1 \u0026le; n \u0026le; 30)** and **k (0 \u0026le; k \u0026le; n\u003csup\u003e2\u003c/sup\u003e)**."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and total number of ways one can put the given number of rooks on a chessboard of the given size so that no two of them are in attacking positions. You may safely assume that this number will be less than **10\u003csup\u003e17\u003c/sup\u003e**."}},{"title":"Sample","value":{"format":"MD","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\u003e8\n1 1\n2 1\n3 1\n4 1\n4 2\n4 3\n4 4\n4 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 1\nCase 2: 4\nCase 3: 9\nCase 4: 16\nCase 5: 72\nCase 6: 96\nCase 7: 24\nCase 8: 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Gift! Gift! Gift!","value":{"format":"MD","content":"এইটা পারলে পরের প্রব্লেম এ গিফট! "}}]}