You need a map or a picture of what you are talking about so i can help find you the answer so please take a picture and post it so i can see it.
The angles are the only constraint here that counts. If one of the three interior angles of a supposed triangle is 50 degrees and another is 80 degrees, then the third angle must be 50 degrees. Thus, we have a 50-50-80 triangle, which is isosceles though not a right triangle. If 4 feet is a measure of one of the equal sides of a supposed triangle, then obviously the adjacent side also has measure 4 ft.
The set of angles remains the same (50-50-80), but subject to the constraint mentioned above, the measure of any one of the sides has infinitely many possible values, so long as those values are positive.
So if John gives a pen and pencil to each and all of them are over we know that the no. of pencils and pens should be the same
So we will find the LCM of 15 and 40 that is equal to 120
So John brought 120/15 that is 8 packets of pen and 120/40 that is three packets of pencils
The sum of the inner angles of a polygon with n sides is 
Since your polygon has 6 sides, the sum of its inner angles has to be

On the other hand, the sum of its inner angles is

And it has to be 720, so we have
