@Shishir
cool! this seems to work!!
C[i] = (N-1)/D[i] ; //this is super cool
On Sep 21, 10:29 am, Shishir Mittal 1987.shis...@gmail.com wrote:
Let the denominations be D[] = {1000,500,100},
and amount be N.
Let C[] , denotes the count of each denomination.
for ( i=0 ; i 2 ; i++) {
@Channa
thanks for explaining for the benefit of everybody.
On Sep 22, 4:50 pm, Channa Bankapur channabanka...@gmail.com wrote:
@eSKay, @Ankur, et al.,
Please be aware that there are non-Indians too in the group.
Hi All,
Let me try and define the problem precisely (as far as I can).
The
I disagee. Please don't force your personal opinions on everybody like
this.
Thanks.
On Sep 20, 4:39 pm, ankur aggarwal ankur.mast@gmail.com wrote:
i think there is no use of discussing this ques..
On Sun, Sep 20, 2009 at 2:25 PM, eSKay catchyouraak...@gmail.com wrote:
yes it is
@eSKay, @Ankur, et al.,
Please be aware that there are non-Indians too in the group.
Hi All,
Let me try and define the problem precisely (as far as I can).
The ATM machines, which we generally see in India have the following
behavior when an user tries to withdraw money from their Bank account.
Let the denominations be D[] = {1000,500,100},
and amount be N.
Let C[] , denotes the count of each denomination.
for ( i=0 ; i 2 ; i++) {
C[i] = (N-1)/D[i] ;
N = N - D[i]*C[i] ;
}
C[2] = N/D[2] ;
For N=4800, C[] = {4, 1, 8}
For N= 2000, C[] = {1, 1, 5}, as required.
Nice
I don't quite get the if possible clause.
But here is what we can do. Have an array C[i] with counts correspondint to
denominations in D[i] (ordered).
From the lowest denomination assign 1 of each until the total doesn't exceed
the required amount. Once that is done, from the highest denomination
Is it different from classic Coin Denomination problem?
_dufus
On Sep 19, 11:20 pm, eSKay catchyouraak...@gmail.com wrote:
for example: if I draw 2000, what I get is
1000+500+100+100+100+100+100.
What algorithm can be used to decide how to break up the entered
amount?
yes it is different.
Coin Denomination Problem [http://haroonsaeed.wordpress.com/2006/06/06/
coin-denomination-problem/] [http://www.seeingwithc.org/
topic1html.html]
would give 2000=1000+1000.
Thats not the case with an ATM machine.
On Sep 20, 10:21 am, Dufus rahul.dev.si...@gmail.com wrote:
@dufus
i dont think
becoz if u have to take 1000rs then we have 500 note and 100 rs note
though we have 1000rs note.
IT is in INDIA..
i dont know about other countries
On 9/20/09, Dufus rahul.dev.si...@gmail.com wrote:
Is it different from classic Coin Denomination problem?
_dufus
On Sep
i think there is no use of discussing this ques..
On Sun, Sep 20, 2009 at 2:25 PM, eSKay catchyouraak...@gmail.com wrote:
yes it is different.
Coin Denomination Problem [http://haroonsaeed.wordpress.com/2006/06/06/
@Ankur I cannot agree more with you
Perhaps a more precise question would have been better instead of just
an observation
_dufus
On Sep 20, 4:39 pm, ankur aggarwal ankur.mast@gmail.com wrote:
i think there is no use of discussing this ques..
On Sun, Sep 20, 2009 at 2:25 PM, eSKay
11 matches
Mail list logo