UVa 488 - Triangle Wave

Summary
Generate a wave of a given frequency and amplitude

Explanation
The obsurity of the problems is within the small number of test cases but given the one given here should make the problem alot clearer.

Gotchas

 * There is a blank line after each separate waveform, excluding the last one.

Input
2

3 2 3 2

Output
1 22 333 22 1

1 22 333 22 1

1 22 333 22 1

1 22 333 22 1