We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Practice
  • Certification
  • Compete
  • Career Fair
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #250: 250250

Project Euler #250: 250250

Problem
Submissions
Leaderboard
Discussions

Find the number of non-empty subsets of , the sum of whose elements is divisible by . Print your answer modulo .

Input Format

The only line of input contains numbers and separated by single space.

Constraints

Output Format

Print the only number your answer.

Sample Input 0

6 50

Sample Output 0

0

Explanation 0

There are no subsets of such that it's sum is divisible by .

Sample Input 1

10 50

Sample Output 1

21

Explanation 1

There are such subsets, e.g. .

Author

yakutovd

Difficulty

Hard

Max Score

100

Submitted By

932

Need Help?


View discussions
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature