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.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #240: Top Dice

Project Euler #240: Top Dice

Problem
Submissions
Leaderboard
Discussions

This problem is a programming version of Problem 240 from projecteuler.net

There are ways in which five -sided dice (sides numbered to ) can be rolled so that the top three sum to . Some examples are:




In how many ways can -sided dice (sides numbered 1 to ) be rolled so that the top sum to ? Print your answer modulo

Input Format

The first and only line of each test file contains exactly integers separated by single spaces: , , and in this order.

Constraints

Output Format

Print exactly one number which is the answer to the problem.

Sample Input 0

5 6 3 15

Sample Output 0

1111

Author

bayleef

Difficulty

Medium

Max Score

100

Submitted By

430

Need Help?


View discussions
View top submissions

rate this challenge

MORE DETAILS

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