
ZOJ Problem Set  3889
Recently, Bob learned the properties of the difference operator Δ, defined by Δf(x) = f(x + 1)  f(x). Now, Bob wants you to construct a sequence S of s integers which satisfies the following properties:
Bob also wants you to construct another sequence T of t integers which satisfies the following properties:
Now, you are given n, a, b, s, t, please construct the two sequence S and T for Bob. Notice:
InputInput will consist of multiple test cases. Each case contains one line with five integers n, a, b, s, t (1 ≤ n < 2^{64}, 1 ≤ s, t ≤ 100, 0 ≤ a, b ≤ 10, a < s, b < t), separated by spaces. OutputFor each cases, output two lines. In the first line, if you find the sequence, output s integers S(1), S(2), ..., S(s), separated by one space. Otherwise just output "1". If there are multiple sequences meeting the conditions, you should output the lexicographically smallest one. In the second line, if you find the sequence, output t integers T(1), T(2), ..., T(t), separated by one space. Otherwise just output "1". If there are multiple sequences meeting the conditions, you should output the lexicographically largest one. Please print a blank line between cases. Sample Input5 0 0 3 2 5 1 0 4 2 Sample Output1 2 3 5 4 1 5 4 Author: LIN, Xi Source: ZOJ Monthly, July 2015 