Game

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

There are two arrays of integers aa and bb of length nn and mm, respectively.

There is a chosen position in each array. Denote the chosen position in aa as cc and in bb as dd. The state is a tuple (c,dc, d). The chosen positions are never out of bounds, i.e. 1cn1 \leq c \leq n and 1dm1 \leq d \leq m. At the start of the game both cc and dd are equal to 11.

Two players are playing a game taking turns alternately. On his turn each player must do one of the following:

  1. Move. Change the chosen position in one of the arrays. You can't change a chosen position to itself. It is not allowed to make a move which will result in a state appearing for the 1022810^{228}-th time. The starting state is considered as having appeared once at the beginning of the game.
  2. Screw you guys, I'm going home. Finish the game.

Note that there are nmn \cdot m states and each state appears no more than 10228110^{228} - 1 times. Therefore the game is finite.

The score of the game is equal to the sum of elements on the chosen positions, i.e. a_c+b_da\_c + b\_d. The player who moves first minimizes it by playing accordingly and the one who moves second maximizes it.

What is the score of the game assuming perfect play from both sides?

입력

The first line contains two nn and mm (1n,m1051 \leq n, m \leq 10^5), lengths of arrays aa and bb, respectively.

The second line contains nn integers a_ia\_i (1a_i1081 \leq a\_i \leq 10^8), the elements of aa.

The third line contains mm integers b_ib\_i (1b_i1081 \leq b\_i \leq 10^8), the elements of bb.

출력

Output a single integer --- the score of the game.