Sum of Strings
We all know that the sum of two numbers is simply the result of adding them together, but in this time we will deal with strings. We define the "sum of two strings" is to connect them together. For example, we have two strings, say s1 and s2, we set the value of s1 as "AB", and s2 as "CD", then the sum of s1 and s2 is "ABCD", i.e. s1+s2="ABCD";
After defining the "sum of strings", we make a special function like this:
Where a and b are two strings given in input data, and f(n) represents a string.
Please help us calculate the value of f(n), when a,b, and n are given.
The first line of the input contains one integer T(1<=T<=100).
Following T lines, every line only contains two strings a,b and three integers n, i, and j; (0<=n<=10^8, 0<=i<=j<=10^8) Using the functions above to output the substring of f(n), from i to j. The two strings will contain no spaces, and their length never exceeds 1000.
The data are specially chosen so that i and j will strictly smaller than the length of f(n), and |i-j|<=1000;
3
Saionji Sekai 0 1 3
Ito Makoto 1 0 3
Katsura Kotonoha 2 5 8Output:
Case #1: aio
Case #2: Mako
Case #3: raKo Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.