VSEPR Strikes Back! [Revamped Again]
Ruby, 250
s=gets
e=7-&quot;FBOSN C&quot;.index(s[0])/2+(s[1]==?l?3:0)
x=s.reverse!.to_i
e+=&quot;Frl&quot;.index(s[2])?x:0
t=&quot;trigonal &quot;
puts [[&quot;linear&quot;,b=&quot;bent&quot;,b],[t+&quot;planar&quot;,t+p=&quot;pyramidal&quot;,&quot;T-shaped&quot;],[&quot;tetr&quot;+h=&quot;ahedral&quot;,&quot;seesaw&quot;],[t+&quot;bi&quot;+p,&quot;square &quot;+p],[&quot;oct&quot;+h]][x-2][e/2-x]

Note that with the rules as they are, AX2E3 and AX4E2 are not possible with the given elements, so they are not supported. All test cases passed.
with comments
s=gets                                     #get input with newline attached
e=7-&quot;FBOSN C&quot;.index(s[0])/2+(s[1]==?l?3:0) #calculate the number of electrons (not lone pairs) from A. Note the addition required to differentiate C and Cl.
x=s.reverse!.to_i                          #reverse the input string so the number is at the beginning (after the newline) and evaluate the string as a number to get X.
e+=&quot;Frl&quot;.index(s[2])?x:0                   #if the character after the number is in &quot;Frl&quot; we have a halogen so increment number of electrons accordingly.
t=&quot;trigonal &quot;                              #as &quot;trigonal &quot; goes at the beginning of the string, we cannot define it on the fly, it is defined as a constant here.
                                           #array of outputs below. note the subscripts at the end: x-2 to put it in the range 0..4 and e/2-x to convert e into the actual number of lone pairs.
puts [[&quot;linear&quot;,b=&quot;bent&quot;,b],[t+&quot;planar&quot;,t+p=&quot;pyramidal&quot;,&quot;T-shaped&quot;],[&quot;tetr&quot;+h=&quot;ahedral&quot;,&quot;seesaw&quot;],[t+&quot;bi&quot;+p,&quot;square &quot;+p],[&quot;oct&quot;+h]][x-2][e/2-x]