You are given a set of N positive integers and another integer P, where P is a small prime. You need to write a program to count the number of subsets of size (cardinality) 3, the sum of whose elements is divisible by P. Since the number K of such sets can be huge, output K modulo 10007 1009 (the remainder when K is divided by 1009)
Constraints
N <= 500
P<50
All integers <=1000
Answers
Answered by
0
Tex
intrftm.
integral
another integer P, where P is a small prime. You need to write a program to count the number of subsets of size (cardinality) 3, the sum of whose elements is divisible by P. Since the number K of such sets can be huge, output K modulo 10007 1009 (the remainder when K is divided by 1009)
Constraints
N <= 500
P<50
All integers <=1000
Answered by
1
Answer:
It can give the remainder to the promotion of the divisible elements.....
Similar questions
English,
5 months ago
Social Sciences,
5 months ago
Social Sciences,
11 months ago
History,
11 months ago
Hindi,
1 year ago
Math,
1 year ago