ghost9's blog

By ghost9, history, 6 weeks ago, In English,

You are provided with coins of denominations "a" and "b". You are required to find the least value of n, such that all currency values greater than or equal to n can be made using any number of coins of denomination "a" and "b" and in any order. If no such number exists, print "-1" in that case. how can i solve this question ?

  • Vote: I like it
  • -4
  • Vote: I do not like it

6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

it is a simple problem based on the Chicken McNugget Theorem. You can use the theorem to get your answer. for proves, refer to this link: