we have coins of a, b, c. and the shopkeaper also have the same. to purchase some thng we have to pay x rupees to shop keaper, he can also return coins to us. Write a program to find the minimum no. of coins required for transaction.
mind
Collapse
X
-
Tags: None
-
That's a simple IP problem (Integer Programming); let n1, n2, n3 be the numberOriginally posted by coolbikash89we have coins of a, b, c. and the shopkeaper also have the same. to purchase some thng we have to pay x rupees to shop keaper, he can also return coins to us. Write a program to find the minimum no. of coins required for transaction.
of coins of value a, b and c paid by the customer and m1, m2, n3 be the number
of coins returned by the shopkeeper. The single constraint is:
n1*a + n2*b + n3*c - m1*a - m2*b - m3*c == x
The cost function is n1+n2+n3+m1+m2+ m3 which should be minimized.
kind regards,
JosComment
-
-
we want a c program for thatOriginally posted by JosAHThat's a simple IP problem (Integer Programming); let n1, n2, n3 be the number
of coins of value a, b and c paid by the customer and m1, m2, n3 be the number
of coins returned by the shopkeeper. The single constraint is:
n1*a + n2*b + n3*c - m1*a - m2*b - m3*c == x
The cost function is n1+n2+n3+m1+m2+ m3 which should be minimized.
kind regards,
JosComment
Comment