Three non-overlapping regular plane polygons, at least two of which are congruent, all have sides of length $1$. The polygons meet at a point $A$ in such a way that the sum of the three interior angles at $A$ is $360^{\circ}$. Thus the three polygons form a new polygon with $A$ as an interior point. What is the largest possible perimeter that this polygon can have? 
$\mathrm{(A) \ }12 \qquad \mathrm{(B) \ }14 \qquad \mathrm{(C) \ }18 \qquad \mathrm{(D) \ }21 \qquad \mathrm{(E) \ } 24$
We are looking for three regular polygons such that the sum of their internal angle sizes is exactly $360^{\circ}$. 
Let the number of sides in our polygons be $3\leq a,b,c$. From each of the polygons, two sides touch the other two, and the remaining sides are on the perimeter. Therefore the answer to our problem is the value $(a-2)+(b-2)+(c-2) = (a+b+c)-6$.
The integral angle of a regular $k$-gon is $180 \frac{k-2}k$. Therefore we are looking for integer solutions to:
\[360 = 180\left( \frac{a-2}a + \frac{b-2}b + \frac{c-2}c \right)\]
Which can be simplified to:
\[2 = \left( \frac{a-2}a + \frac{b-2}b + \frac{c-2}c \right)\]
Furthermore, we know that two of the polygons are congruent, thus WLOG $a=c$. Our equation now becomes
\[2 = \left( 2\cdot\frac{a-2}a + \frac{b-2}b \right)\]
Multiply both sides by $ab$ and simplify to get $ab - 4b - 2a = 0$.
Using the standard technique for [Diophantine equations](https://artofproblemsolving.com/wiki/index.php/Diophantine_equation), we can add $8$ to both sides and rewrite the equation as $(a-4)(b-2)=8$.
Remembering that $a,b\geq 3$ the only valid options for $(a-4,b-2)$ are: $(1,8)$, $(2,4)$, $(4,2)$, and $(8,1)$.
These correspond to the following pairs $(a,b)$: $(5,10)$, $(6,6)$, $(8,4)$, and $(12,3)$. 
The perimeters of the resulting polygon for these four cases are $14$, $12$, $14$, and $\boxed{21}$.