{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"Long time ago, there was a strange kingdom. Peoples of different religions, different cultures used to live there. But as they were different, their names were also different. So, in schools, offices, it was quite tough to call someone using his/her name, because some names were too hard to be pronounced by persons from different culture.\n\nSo, the king made a plan. He took a string **S** and two integers **p** and **q** and made a rule that names of the babies should be a substring of **S**, and the length should be between **p** and **q** (inclusive).\n\nNow you are given **S**, **p** and **q** you have to find the number of distinct names that can be made."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 100)**, denoting the number of test cases.\n\nEach case starts with a line containing a string **S**. The length of **S** will be between **2** and **10000** (inclusive) and **S** contains lowercase English letters only. The next line contains two integer **p** and **q (1 \u0026le; p \u0026le; q \u0026le; length(S))**."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and the number of distinct names that can be made."}},{"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\u003e1\nabcdef\n2 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 14\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}