#Lutece0534. Sum of Strings

Sum of Strings

Migrated from Lutece 534 Sum of Strings

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

定义两个字符串s1s_1s2s_2的和是这两个字符串首尾相连,比如给定两个字符串

s1=s_1=ABs2=s_2=CD,它们的和s1+s2=s_1+s_2=ABCD

根据以上定义,我们定义如下函数

$$$f(n)= \begin{cases} a & n=0\\ b & n=1\\ f(n-2)+f(n-1) & n>1 \end{cases}$$$$$ # Input # 第一行包含一个整数$T$,代表测试数据组数。($T\leq 100$) 接下来$T$行,每行包括两个字符串$a,b$和三个整数$n,i,j$ ($0\leq n\leq 10^8$, $0\leq i\leq j\leq 10^8$) ,输出$f(n)$中从$i$到$j$的一段子串,$a$和$b$的长度不超过$1000$,而且不包含空格。 我们保证$i$和$j$的大小均严格小于$f(n)$的长度,且$|i-j|\leq 1000$; # Output # 对每组测试数据,输出所要求的一段子串。更多信息请参考样例。 # Samples # ```input1 3 Hello World 0 1 3 Tanaka Yubiseiharukana 1 0 3 aaa bbb 2 1 4 ``` ```output1 ell Yubi aabb ``` # Resources # kennethsnow $$