Exact value for the average optimal cost of the bipartite traveling salesman and two-factor problems in two dimensions