Solution for UVa #151
Merge branch 'kn'