UVa 400 - Unix ls

Summary
Sort and output a list of filenames in the format given.

Explanation

 * 1) Determine how long the longest filename is.
 * 2) Determine how many columns/rows you must have.
 * 3) Output each row as specified in the problem.

Input
5 koala.jpg australia.exe kangaroo.txt foo.bar homer.simpson 2 www.algorithmist.com acm.uva.es

Output
australia.exe homer.simpson  koala.jpg foo.bar       kangaroo.txt

acm.uva.es           www.algorithmist.com