{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"An integer is divisible by 3 if the sum of its digits is also divisible by 3. For example, 3702 is divisible by 3 and 12 (3+7+0+2) is also divisible by 3. This property also holds for the integer 9.\n\nIn this problem, we will investigate this property for other integers."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 200)**, denoting the number of test cases.\n\nEach case contains three positive integers **A, B** and **K (1 \u0026le; A \u0026le; B \u0026lt; 2\u003csup\u003e31\u003c/sup\u003e and 0 \u0026lt; K \u0026lt; 10000)**\u003e."}},{"title":"Output","value":{"format":"MD","content":"For each case, output the case number and the number of integers in the range **[A, B]** which are divisible by **K** and the sum of its digits is also divisible by **K**."}},{"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\u003e3\n1 20 1\n1 20 2\n1 1000 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 20\nCase 2: 5\nCase 3: 64\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}