Apr 1, 2008

Team Photo Problem

Since three guys (Ghoida, Nini and Dinu Kaka) from our team have decided to move on, its time to take a team photo. Camera man proposed that for a nice photo people should arrange themselves in such a way that the height difference between two adjacent guys are minimum. Since Dinu Kaka is the senior most of all three, we decided to keep him at the center and Nini and Ghoida will be at either ends (one at left and the other at right). Nini being so enthusiastic about his analytical skills decides to write an algorithm that will ensure that average height gaps of the arrangement is minimum. Any idea how he would do it? If there are even team members, Dinu Kaka may choose any of the two mid positions as he wish (and since he is a nice guy, he would accept any of the two positions that Nini tells him to go to).

No comments: