Japt, 36 33 2434 bytes
HÆÐU+Xn)eHÆÐU+XnÃf@¤¤ÅɶXÎÃme
èÈ©n6Ã*L/UèÊUÊ r
Not pretty at all! Needs more work.
34 31 2232 bytes
2 bytes can be saved by always rounding down as the challenge doesn't specify that we must round to the nearest integer:
HÆÐU+Xn)eHÆÐU+XnÃf@¤¤ÅɶXÎÃme
èÈ©n6ÃzUèÊèÈ©n6ÃzUÊ/L