{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"You are given a 3D grid, which has dimensions **X**, **Y** and **Z**. Each of the **X x Y x Z** cells contains a light. Initially all lights are off. You will have **K** turns. In each of the **K** turns,\n1. You select a cell **A** randomly from the grid,\n2. You select a cell **B** randomly from the grid and\n3. Toggle the states of all the bulbs bounded by cell **A** and cell **B**, i.e. make all the `ON` lights `OFF` and make all the `OFF` lights `ON` which are bounded by **A** and **B**. To be clear, consider cell **A** is **(x\u003csub\u003e1\u003c/sub\u003e, y\u003csub\u003e1\u003c/sub\u003e, z\u003csub\u003e1\u003c/sub\u003e)** and cell **B** is **(x\u003csub\u003e2\u003c/sub\u003e, y\u003csub\u003e2\u003c/sub\u003e, z\u003csub\u003e2\u003c/sub\u003e)**. Then you have to toggle all the bulbs in grid cell **(x, y, z)** where **min(x\u003csub\u003e1\u003c/sub\u003e, x\u003csub\u003e2\u003c/sub\u003e) \u0026le; x \u0026le; max(x\u003csub\u003e1\u003c/sub\u003e, x\u003csub\u003e2\u003c/sub\u003e)**, **min(y\u003csub\u003e1\u003c/sub\u003e, y\u003csub\u003e2\u003c/sub\u003e) \u0026le; y \u0026le; max(y\u003csub\u003e1\u003c/sub\u003e, y\u003csub\u003e2\u003c/sub\u003e)** and **min(z\u003csub\u003e1\u003c/sub\u003e, z\u003csub\u003e2\u003c/sub\u003e) \u0026le; z \u0026le; max(z\u003csub\u003e1\u003c/sub\u003e, z\u003csub\u003e2\u003c/sub\u003e)**.\n\nYour task is to find the expected number of lights to be ON after **K** turns."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 50)**, denoting the number of test cases.\n\nEach case starts with a line containing four integers **X, Y, Z (1 \u0026le; X, Y, Z \u0026le; 100)** and **K (0 \u0026le; K \u0026le; 10000)**."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and the expected number of lights that are ON after **K** turns. Errors less than **10\u003csup\u003e-6\u003c/sup\u003e** will be ignored."}},{"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\u003e5\n1 2 3 5\n1 1 1 1\n1 2 3 0\n2 3 4 1\n2 3 4 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 2.9998713992\nCase 2: 1\nCase 3: 0\nCase 4: 6.375\nCase 5: 9.09765625\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}