Believe it or not, that was my initial draft in one-liner version. But I then decided to write it in a full script, and followed citromatik's style in hash building with a little modification. Don't get me wrong, I do like slices :-) OTOH, I intentionally focused on the input parsing and output printing parts, where citromatik's version seems to suffer from, in efforts and clarity.
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!