Revealing the nature of intermolecular interaction and configurational preference of the nonpolar molecular dimers (H2)2, (N2)2, and (H2)(N2)