Delivery

No attempts yetTime limit1sMemory limit128 MB

Problem

A crab-porridge shop runs two kinds of delivery to help its neighbors. One is a paid order, delivered to a paying customer, and the other is a free meal, delivered at no charge to a student in need.

The shop has only one courier, so that single courier handles both the paid orders and the free meals. The owner insists on a first-come, first-served rule for the delivery order:

  • Paid orders must be delivered in the order they were placed (an earlier order is served first).
  • Free meals must be delivered in the order they were requested (an earlier request is served first).
  • However, the relative order between a paid-order customer and a free-meal recipient may be interleaved freely.

For example, if orders arrive as A,B,CA, B, C and free-meal requests arrive as X,Y,ZX, Y, Z, then BB must be delivered after AA and before CC, but its timing relative to X,Y,ZX, Y, Z does not matter.

The courier starts at the shop, whose location is (0,0)(0, 0). Find the shortest total distance the courier must travel to complete every delivery. The distance between two points is the Euclidean (straight-line) distance on the plane, and the courier does not need to return to the shop after the last delivery.

Input

Input is given through standard input.

The first line contains the number of test cases TT (1T201 \le T \le 20).

The first line of each test case contains the number of paid orders NN (1N201 \le N \le 20) and the number of free-meal requests MM (1M201 \le M \le 20), separated by a single space.

The next NN lines give the coordinates of the paid-order destinations, one per line, in the order the orders were placed. The following MM lines give the coordinates of the free-meal destinations, one per line, in the order the requests were made.

Each coordinate consists of two integers xx and yy (0x1000 \le x \le 100, 0y1000 \le y \le 100), separated by a single space.

Output

For each test case, print on its own line the shortest total distance one courier needs to complete both kinds of delivery.

Round the value at the second decimal place and print it to one decimal place.