UVa 488 - Triangle Wave

488 - Triangle Wave

 * http://acm.uva.es/p/v4/488.html

Summary
Generate a wave of a given frequency and amplitude

Explanation
The obscurity of the problems is within the small number of test cases, but given the one given here should make the problem a lot clearer.

Gotchas

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

Input
2

3 2 4 3

Output
1 22 333 22 1

1 22 333 22 1

1 22 333 4444 333 22 1

1 22 333 4444 333 22 1

1 22 333 4444 333 22 1