'' Calculate pairs of similar rectangles from its common ratio
for x in umap : NEW_LINE INDENT value = umap [ x ] NEW_LINE if ( value > 1 ) : NEW_LINE INDENT ans += ( value * ( value - 1 ) ) / 2 NEW_LINE DEDENT DEDENT return ans NEW_LINE