QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 256 MB مجموع النقاط: 100

#22777. Sum25

الإحصائيات

Write a program that inputs 7 digits ($0 \le \text{each digit} \le 9$) and counts the number of ways one can extract a set of digits to sum to 25. The digit `0' means 10, not 0.

This input:

5 0 1 5 4 3 7

yields five different sums to 25:

        5 0       3 7
        5   1 5 4 3 7
        5 0 1 5 4
          0 1   4 3 7
          0   5   3 7

Input

A single line with seven single digit integers.

Output

A single line that tells the number of subsets that sum to 25.

Examples

Input 1

5 0 1 5 4 3 7

Output 1

5

Problem credits: Don Piele, 1982

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.