Input a number of various integer sequences (0…999) line by line. Rotate the whole structure clockwise and output it using «"%3d"» format. Trailing spaces are ignored (you may both leave or strip them).
173 864 629 283 277 563 969 907 785 415 100 944 972 784 722 925 784 446 494 65 572 120 150 153 511 204 743 199 963 334 955 663 128 946 642 5 758 310 363
Hint: while solving this task, I've used an additional array Total to store start index of each sequence. E. g. in the example above Total became 0, 3, 9, 17, 20, 24, 32, 39 (last number is total length).
(Captain Obvious suggests): Total[i+1]-Total[i] is the sequence's length.
128 511 572 446 415 283 173 946 204 120 494 100 277 864 642 743 150 65 944 563 629 5 199 153 972 969 758 963 784 907 310 334 722 785 363 955 925 663 784