NPS-INR-Cyber-Programming-2021

The 2021 edition of the NPS Indiranagar interhouse Cyber Programming contest.

View on GitHub

Mr. Beast’s Generous Giveaway

Problem Statement:

YouTube has hired Mr. Beast to host their new event to support rising content creators. As usual, to make things impressive, Jimmy (Mr. Beast) decides to give-away $M in coins.

However, Jimmy’s bank only has coins of denominations in the array F.

Determine how many ways change can be made for amount $M. There are an infinite number of coins of each denomination

Example:
M = 4
F = {10,4,1,2}
There are 4 ways to make change for M: {4}, {1,1,1,1}, {2,1,1}, {2,2}.

Constraints:

Input Format:

Output Format:

Sample input:

10 4 2 5 3 6 

Sample output:

5