Number of ways of dividing an array into 2 parts such that sum of each part is > k

Revision en1, by DaviddeGea1, 2019-10-27 11:54:36

I got this problem in an off-campus round, someone please help me solve the problem:

You are given N elements, each having unique values. If you distribute them among 2 children in such a way that the total unique value that each child receives must be greater than K. How many ways can you distribute the elements so that the mentioned condition holds true?

Since the answer can be very large print it modulo 1e9+7.

1 <= N <= 10^3

1 <= K <= 10^5

1 <= A[i] <= 10^9

Tags #combinatorics, maths, #modular arithmetic

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English DaviddeGea1 2019-10-27 12:01:03 99
en1 English DaviddeGea1 2019-10-27 11:54:36 565 Initial revision (published)