Average Out Two Lists Average out two lists

Challenge

Given two lists of positive integers, determine whether it is possible to rearrange the elements into two new lists such that the new lists have the same arithmetic mean (average).

Input

The input can be taken through STDIN or as function arguments. Input can be taken as a list, or if your language doesn't support lists (or anything similar such as arrays/dictionaries) then the input can be taken as a comma- or space-delimited string. That is,

"1 4 8 2 5,3 1 5 2 5"


is the same as:

[ [1,4,8,2,5], [3,1,5,2,5] ]


All input lists will be the same length.

Output

If you can create two new lists with the same average, your program/function should print or return the mean. If you can't, your program should output a sad face :(.

Note that the rearranged lists with equal means, if they exist, need not has the same length. Any number of swaps can be made to create the new lists.

Examples

1 4 8 2 5,3 1 5 2 5 -&gt; 1 4 8 2 3,5 1 5 2 5 (swapped 3 and 5) -&gt; 3.6
1 3 6 2,16 19 19 14 -&gt; [[1,6,19,14],[3,2,16,19]] -&gt; 10
2 6 2,6 3 5 -&gt; 2 6,2 6 3 5 (moved 2) -&gt; 4
90 80 20 1,40 60 28 18 -&gt; :(




This is code-golf so shortest code in bytes wins. As always, standard loopholes are disallowed.
Pyth, 24 bytes

?}KcsJsQlJmcsdldtPyJK":(


Try it online: Demonstration

Thanks to Dennis for noticing an error and golfing one byte. 

Explanation:

?}KcsJsQlJmcsdldtPyJK":(   implicit: Q = evaluated input
      sQ                   all numbers of Q
     J                     save them in J
  KcsJ  lJ                 average of J (sum(J) / len(J))
                           store in K
          m     tPyJ       map each nonempty subset d of J to:
           csdld             average of d
?}                         if K in ^:
                    K        print K
                     ":(   else print sad-face