ACSL Triangles - JR - 1

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

ACSL

2007 - 2008 American Computer Science League Contest #1


Junior Division

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 is
equal to 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 and the last 3 numbers are the lengths for the second triangle.

OUTPUT: For each data line print the largest number of pairs of equal sides that exists
when all pairings of the sides are considered.

SAMPLE INPUT SAMPLE OUTPUT

1. 2, 3, 4, 4, 3, 2 1. 3
2. 3, 4, 5, 5, 2, 3 2. 2
3. 2, 3, 4, 2, 3, 4.5 3. 2
4. 2, 2, 3, 3.5, 2, 2 4. 2
5. 2, 2, 2, 1, 2, 2.5 5. 1
ACSL
2007 - 2008 American Computer Science League Contest #1
Junior Division

Triangles

TEST DATA

TEST INPUT TEST OUTPUT

1. 3, 4, 5, 3, 4, 5 1. 3
2. 5, 7, 11, 11, 7, 6 2. 2
3. 6, 8, 10, 4, 6, 8 3. 2
4. 6, 8, 10, 5, 7, 12 4. 0
5. 9, 12, 15, 12, 9, 15 5. 3

You might also like