Coin change with the type of specific coin as the returned value
<p>I need to write this function that calculates the minimum number of the coins to get the specified value.</p>

<p>the function as a parameter has a value (int) and an string the has information about the type of coin and its value (its a bit different from the classic version on coin change)</p>

<p>as an example :</p>

<p><code>coin(20, "a:9,b:2,c:1");</code></p>

<p>so i have the value 20. 
In this case I have the coin called 'a' with value of 9, coin 'b' with value of 2 and coin 'c' with value 1 
So this function at the end will return me 'aab' that meens that i used 2 time the coin 'a' and one time the coin 'b' which is minimum
Here are some othere test cases:</p>

<p><code>assert(strcmp(coin(4, "a:5,b:2,c:1"),"bb")==0);
assert(strcmp(coin(12,"a:3,b:2"),"aaaa")==0);</code></p>

<p>Hope someone can help me with this.
I already saw some example (<a href="http://code.geeksforgeeks.org/jeuR48" rel="nofollow">http://code.geeksforgeeks.org/jeuR48</a>) with same issue but i really dont have any idea how i can manage the type of coin  </p>