ACSL Triangles - Int - 1
ACSL Triangles - Int - 1
ACSL Triangles - Int - 1
Triangles
PROBLEM: Two triangles are congruent if for some pairing of their sides the lengths of
those paired sides are equal.
4
B D E
3 2 2 3
A C
4 F
In the diagram above ∆ ABC is congruent to ∆ EFD. Note that the length of side AB
equals the length of side EF, the length of side BC is equal to the length of side FD and
the length of side AC is equal to the length of side ED. This is the pairing of the sides
that makes the triangles congruent.
INPUT: There will be 5 lines of data. Each line will contain 6 positive rational numbers
that represent the lengths of the sides of two triangles. The first 3 numbers are the lengths
for the first triangle (∆ ABC) in the order AB, BC, AC and the last 3 numbers are the
lengths for the second triangle (∆ DEF) in the order DE, EF, DF.
OUTPUT: For each data line, print the name of the triangle that is congruent to ∆ ABC.
If no pairing makes the triangles congruent print NONE.
1. 2, 3, 4, 2, 3, 4 1. DEF
2. 2, 3, 4, 4, 3, 2 2. DFE
3. 2, 3, 4, 3, 2, 4 3. FED
4. 2, 3, 4, 2, 3, 5 4. NONE
5. 2, 3.5, 4, 2, 4, 3.5 5. EDF
ACSL
2007 - 2008 American Computer Science League Contest #1
Intermediate Division
Triangles
TEST DATA
1. 3, 4, 5, 3, 4, 5 1. DEF
2. 5, 7, 12, 12, 7, 5 2. DFE
3. 6, 8, 10, 4, 6, 8 3. NONE
4. 6, 8, 10, 8, 10, 6 4. FDE
5. 9, 12, 15, 12, 9, 15 5. FED