PSG - Kruzade'10 Code Chaos - Finals' Question

24/02/2011 19:27

Here is the Question for you!
This is a triangle of points, Each point has been numbered as in the triangle below. The Task is to find whether the given input points will make the following!
1. Triangle, if three points are given.
2. Parallelogram, if four points are given.
3. Hexagon, if six points are given.

                                    *       
                                *        *       
                            *        *        *       
                        *        *        *        *       
                    *        *        *        *        *       
                *        *        *        *        *        *       
            *        *        *        *        *        *        *       
        *        *        *        *        *        *        *        *       
    *        *        *        *        *        *        *        *        *       
*        *        *        *        *        *        *        *        *        *       

                                    1       
                                2        3       
                            4        5        6       
                        7        8        9        10       
                    11        12        13        14        15       
                16        17        18        19        20        21       
            22        23        24        25        26        27        28       
        29        30        31        32        33        34        35        36       
    37        38        39        40        41        42        43        44        45       
46        47        48        49        50        51        52        53        54        55       


Sample Inputs and Outputs:

1,2,3            Triangle
19,26,20        Triangle
44,36,28        Not a Triangle
20,44,41        Triangle
18,19,31,32        Paralellogram
33,52,36,55        Paralellogram
8,17,24,13        Not a Paralellogram
2,4,8,9,6,3        Hexagon
1,2,3,8,9,13    Hexagon

(Base Should be Horizontal for Triangle and Parallelogram)
For any other combination of inputs, output as invalid input combinations.