Gimenez Carlos, Contractor
_Morning my friend. We want a building.
GCC: ¿what kind of building will please you?
_ A building, you know. The kind that has walls.
GCC: ok, done.
_ Great, that was fast. I want you to meet the architect. So Mr. architect ¿how many floors do you want?
_ 42
GCC: the building is already constructed. It has 13 floors.
_ Now we need to paint it. Let's go to the 54 floor.
GCC: That would be difficult...
_ (not listening) ¿What colour do we choose?
_ Let's start with Red, next Green, Green and Green. Blue later. Draw a tiger here, a river and the treasure map.
Cover everything with black.
GCC: *sigh*
...
_ We'll pay you 10 times the cost of the first floor. But calculate it twice, just to be sure
_ Now the speech for the inauguration:
All work and no play makes Jack a dull boy.
All work and no play makes Jack a dull boy.
All work and no play makes Jack a dull boy.
...
And that's basically the story of your code.
Also your sort is obfuscated and you are accessing out of bounds.