Tap here to switch tabs
Problem
Submissions

Problem: The Number of Ways to Make the Sum

The Number of Ways to Make the Sum asks you to count distinct combinations reaching a target, using unlimited coins worth one, two, or six and at most two worth four. Return it modulo a large prime.

Statement

You are given an integer n. You have an infinite supply of coins with values 11, 22, and 66, and at most two coins of value 44.

Return the total number of distinct combinations of coins that sum up to n. Since the answer may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq n ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: The Number of Ways to Make the Sum

The Number of Ways to Make the Sum asks you to count distinct combinations reaching a target, using unlimited coins worth one, two, or six and at most two worth four. Return it modulo a large prime.

Statement

You are given an integer n. You have an infinite supply of coins with values 11, 22, and 66, and at most two coins of value 44.

Return the total number of distinct combinations of coins that sum up to n. Since the answer may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq n ≤105\leq 10^5