Read problems statements in Mandarin Chinese  and Russian. 

Alok-nath is man of equality. He needs your help to divide his “sanskars” evenly amongst all his followers. By doing this, Alok-nath can create equality amongst his followers and he'll be called a true “sanskari”.

Alok-nath has N sanskars, and K followers. Each sanskar is given a numerical value which shows its intensity.

Your task is to determine whether it is possible to allocate all the sanskars to followers in such a way that the sum of intensities of the sanskars allocated to each follower is equal. Note : A sanskar can be allocated to only one of the followers.

------ Input ------ 

The first line of the input contains an integer T, denoting the number of test cases. Then T test cases follow. The first line of each case contains two integers N and K, with N denoting the number of sanskars and K denoting the number of followers. In the next line are N space separated integers denoting the intensities of each sanskar.

------ Output ------ 

For each test case, output "yes" if it is possible to divide his sanskars equally amongst his followers; otherwise output "no" (without quotes).

------ Constraints ------ 

$1 ≤ T ≤ 10$
$1 ≤ N ≤ 21$
$1 ≤ K ≤ 8$
$Subtask #1 (20 points) : 0 ≤ intensity of sanskar ≤ 10^{5}$
$Subtask #2 (80 points) : 0 ≤ intensity of sanskar ≤ 10^{10}$

----- Sample Input 1 ------ 
2
5 3
1 2 4 5 6
5 3
1 2 4 5 7
----- Sample Output 1 ------ 
yes
no
----- explanation 1 ------ 
In the first case, sanskars can be allocated as follows, each follower receiving a total intensity of 6: {1,5}, {2,4}, {6}.

Difficulty: HARD

Solutions:
def divide(l, num, dn):
	if dn == 0:
		return True
	if num == -1:
		return False
	if l[num] > dn or l[num] == 0:
		return divide(l, num - 1, dn)
	if divide(l, num - 1, dn - l[num]):
		l[num] = 0
		return True
	return divide(l, num - 1, dn)
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = sorted(list(map(int, input().split())))
	if sum(l) % k != 0 or n < k:
		print('no')
		continue
	dn = sum(l) // k
	ans = False
	if l[n - 1] <= dn:
		ans = True
	for i in range(k):
		if not divide(l, n - 1, dn):
			ans = False
			break
	print('yes') if ans == True else print('no')


import math
import bisect

def power(x, y, p):
	res = 1
	x = x % p
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def inn():
	return int(input())

def inl():
	return list(map(int, input().split()))

def partition(arr, num, ps):
	if ps == 0:
		return True
	if num == 0:
		return False
	if arr[num - 1] > ps or arr[num - 1] == 0:
		return partition(arr, num - 1, ps)
	if partition(arr, num - 1, ps - a[num - 1]):
		arr[num - 1] = 0
		return True
	return partition(arr, num - 1, ps)
MOD = 10 ** 9 + 7
INF = inf = 10 ** 18 + 5
for t in range(int(input())):
	(n, k) = inl()
	a = inl()
	a.sort()
	s = sum(a)
	if s % k != 0 or n < k:
		print('no')
		continue
	ans = False
	ps = s // k
	if a[n - 1] <= ps:
		ans = True
		for i in range(k):
			if not partition(a, n, ps):
				ans = False
				break
	print('yes') if ans else print('no')


def ret_res(arr, vis_arr, ind, memo, val):
	if (ind, val) in memo:
		return memo[ind, val]
	elif val < 0:
		return None
	elif val == 0:
		return []
	elif ind == -1:
		return None
	elif not vis_arr[ind]:
		ret1 = ret_res(arr, vis_arr, ind - 1, memo, val - arr[ind])
		if ret1 != None:
			ret1.append(ind)
			memo[ind, val] = ret1
			return memo[ind, val]
		ret2 = ret_res(arr, vis_arr, ind - 1, memo, val)
		memo[ind, val] = ret2
		return memo[ind, val]
	else:
		ret3 = ret_res(arr, vis_arr, ind - 1, memo, val)
		memo[ind, val] = ret3
		return memo[ind, val]
for i in range(int(input())):
	(n, k) = map(int, input().split())
	arr = sorted(list(map(int, input().split())))
	tot = sum(arr)
	if tot % k == 0 and k <= n:
		val = tot // k
		vis_arr = [False for _ in range(n)]
		for i in range(k):
			path = ret_res(arr, vis_arr, n - 1, {}, val)
			if path == None:
				print('no')
				break
			else:
				for j in path:
					vis_arr[j] = True
		else:
			print('yes')
	else:
		print('no')


import sys
tests = int(input())
for t in range(tests):
	line = input().split()
	sanskars = int(line[0])
	followers = int(line[1])
	intensities = list(map(int, input().split()))
	ti = sum(intensities)
	togive = ti / followers
	go = 1
	if followers > sanskars or round(togive) != togive or max(intensities) > togive:
		print('no')
		go = 0
	if go == 1:
		intensities.sort(reverse=True)

		def give(intensities, runsum, pos):
			if intensities == [] or intensities[0] == 0:
				return 1
			runsum = (runsum + intensities[pos]) % togive
			intensities.pop(pos)
			if runsum == 0:
				return give(intensities, 0, 0)
			p = pos
			for i in intensities[pos:]:
				if runsum + i <= togive:
					topass = intensities[:]
					if give(topass, runsum, p) == 1:
						return 1
				p += 1
			return 0
		print('yes') if give(intensities, 0, 0) == 1 else print('no')