#P4693. Huge String
Huge String
Problem Description
You can get a huge string from a tiny one S by repeating doing following replacement N times.

What's the substring containing M characters starting at the index K?
Input
There are multiple test cases. Process to the End of File.
The first line of each test contains the string S made up of nonspacing graphic characters, whose length doesn't exceed 100. The second line contains three integers: 0 ≤ N ≤ 100, 1 ≤ M ≤ 200 and 0 ≤ K ≤ 1081.
Output
For each test case, output the substring [K, min(length(S), K + M))
W
2 4 8
ACM-ICPC
1 8 0
W
ACM-ICPC
Hint
H.html download 方便图中文字复制
http://pan.baidu.com/share/link?shareid=463767611&uk=352484775
Author
Zejun Wu (watashi)