Problem L
Welcome to Code Jam (Easy)
Note that this is an easier version of the problem welcomehard.
So you’ve registered. We sent you a welcoming email, to welcome you to code jam. But it’s possible that you still don’t feel welcomed to code jam. That’s why we decided to name a problem “welcome to code jam.” After solving this problem, we hope that you’ll feel very welcome. Very welcome, that is, to code jam.
If you read the previous paragraph, you’re probably
wondering why it’s there. But if you read it very carefully,
you might notice that we have written the words “welcome to
code jam” several times:
To be more precise, given a text string, you are to
determine how many times the string “welcome to code jam”
appears as a sub-sequence of that string. In other words, find
a sequence
The result of your calculation might be huge, so for
convenience we would only like you to find the last
Input
The first line of input gives the number of test cases
Output
For each test case, “Case #
Sample Input 1 | Sample Output 1 |
---|---|
3 elcomew elcome to code jam wweellccoommee to code qps jam welcome to codejam |
Case #1: 0001 Case #2: 0256 Case #3: 0000 |