public static int solutionKSum(int[] A,int k,int target) {
		int n=A.length, t=target;
		Arrays.sort(A);
		int[][][] dp=new int[k+1][n+1][t+1];
		for (int i=0;i<=k;++i) 
			for (int j=0;j<=n;++j)
				for (int s=0;s<=t;++s)
					dp[i][j][s]=-1;
		return ksum_helper(A, k, 0, target, dp);
	}