10489  Boxes of Chocolates
Moderator: Board moderators

 Experienced poster
 Posts: 151
 Joined: Wed Aug 21, 2002 12:07 am
 Location: Seoul, Korea
 Contact:
10489  Boxes of Chocolates
Hi!
I just don't get what the problem states.
Are there B large boxes, and for a large box, K1 intermediate boxes in each of them, and a_i smallest boxes in each of the intermediate boxes?
So are there three kinds of boxes? And how can I figure out whether a large box or an intermediate box contains chocolates or not?
Any help will be appreciated..
Regards,
JongMan
I just don't get what the problem states.
Are there B large boxes, and for a large box, K1 intermediate boxes in each of them, and a_i smallest boxes in each of the intermediate boxes?
So are there three kinds of boxes? And how can I figure out whether a large box or an intermediate box contains chocolates or not?
Any help will be appreciated..
Regards,
JongMan

 Experienced poster
 Posts: 193
 Joined: Thu Sep 19, 2002 6:39 am
 Location: Indonesia
 Contact:
Whinii, I agree that it is somewhat confusing ...
I interpreted that input to the following:
Box #1 contains 2 boxes. Each of those 2 boxes contains 3 smaller boxes, each of them contains 4 smaller boxes (these smallest boxes contain chocolates).
turuthok
Code: Select all
1
5 2
3 2 3 4
4 5 2 3 1
Box #1 contains 2 boxes. Each of those 2 boxes contains 3 smaller boxes, each of them contains 4 smaller boxes (these smallest boxes contain chocolates).
turuthok
The fear of the LORD is the beginning of knowledge (Proverbs 1:7).

 Guru
 Posts: 834
 Joined: Wed May 29, 2002 4:11 pm
 Location: Wroclaw, Poland
 Contact:
turuthok, you have right! tha's correct interpretation of problem description
And whinii  only smallest boxes contains chocolates  description says it clearly
Best regards
DM
And whinii  only smallest boxes contains chocolates  description says it clearly
Best regards
DM
If you really want to get Accepted, try to think about possible, and after that  about impossible ... and you'll get, what you want ....
Born from ashes  restarting counter of problems (800+ solved problems)
Born from ashes  restarting counter of problems (800+ solved problems)

 Experienced poster
 Posts: 131
 Joined: Thu Apr 17, 2003 8:39 am
 Location: Baku, Azerbaijan
Hello.
I'll try to explain.
There are B1 boxes,
and B2 boxes in that box,
B3 boxes in B2 box and ... Bn boxes in Bn1.
And only in Bn box there K chocolates.
Now you have to find how many chocolates in all boxes.
The count of the smallest boxes is B1*B2*B3*...*Bn.
Remember that the last boxes only contain chocolates.
The remaining of the problem I think you'll solve yourself
Good luck!
I'll try to explain.
There are B1 boxes,
and B2 boxes in that box,
B3 boxes in B2 box and ... Bn boxes in Bn1.
And only in Bn box there K chocolates.
Now you have to find how many chocolates in all boxes.
The count of the smallest boxes is B1*B2*B3*...*Bn.
Remember that the last boxes only contain chocolates.
The remaining of the problem I think you'll solve yourself
Good luck!
_____________
NO sigNature
NO sigNature

 Experienced poster
 Posts: 151
 Joined: Wed Aug 21, 2002 12:07 am
 Location: Seoul, Korea
 Contact:
Oh
Thanks, now I got the idea.
BTW, Dominik:
How is it clear that none of the intermediate boxes contain chocolates?
from the problem statement I see
BTW, Dominik:
How is it clear that none of the intermediate boxes contain chocolates?
from the problem statement I see
Doesn't this seem to mean that intermediate could contain some chocolates? I think it's a bit confusing.Even sometimes the smaller boxes do not contain any chocolates but have further smaller boxes inside them. Only the smallest boxes always contain some chocolates.

 Experienced poster
 Posts: 151
 Joined: Wed Aug 21, 2002 12:07 am
 Location: Seoul, Korea
 Contact:
Eh.. what I'm trying to say is that the phrase "Only the smallest boxes always.." could mean "Smallest boxes always contain, and the rest may or may not." At least to me :$
Anyway thank you very much for the attention. =)
Anyway thank you very much for the attention. =)
Last edited by Whinii F. on Wed Apr 30, 2003 11:49 am, edited 1 time in total.

 Guru
 Posts: 834
 Joined: Wed May 29, 2002 4:11 pm
 Location: Wroclaw, Poland
 Contact:
turuthok has right. For me it's clear too, that in box, which are not smallest , there isn't any chocloates )
DM
DM
If you really want to get Accepted, try to think about possible, and after that  about impossible ... and you'll get, what you want ....
Born from ashes  restarting counter of problems (800+ solved problems)
Born from ashes  restarting counter of problems (800+ solved problems)

 Learning poster
 Posts: 90
 Joined: Sat Feb 15, 2003 1:39 am
 Location: Paris, France
 Contact:

 New poster
 Posts: 4
 Joined: Sat Nov 23, 2002 2:00 pm

 Experienced poster
 Posts: 106
 Joined: Sun Feb 17, 2002 2:00 am
 Location: Seoul, South Korea
 Contact:
10489 Box of Chocolates .. Time Limit Exceed
Hhm.... Is there any technique?
I just divide each input number and calculate each remainder.
So result of calculation is the answer.... But I got time limit exceed..
Maybe there are some techniques to decrease time complexity.
Please give me some hints.
Thanks.
I just divide each input number and calculate each remainder.
So result of calculation is the answer.... But I got time limit exceed..
Maybe there are some techniques to decrease time complexity.
Please give me some hints.
Thanks.

 Experienced poster
 Posts: 192
 Joined: Sat Nov 30, 2002 5:14 am

 Learning poster
 Posts: 90
 Joined: Sat Feb 15, 2003 1:39 am
 Location: Paris, France
 Contact:

 Experienced poster
 Posts: 106
 Joined: Sun Feb 17, 2002 2:00 am
 Location: Seoul, South Korea
 Contact:
Oh, How foolish I am!
I found that a little dummy code cause TLE error.. _;
In fact, this problem don't need special technique.
Just need the highschool mathmatics... _;;
( I think the only trap of this problem is overflow...
So I add divide statement, if the current calculating result is too big )
Anyway, I got Accept. Thanks.
I found that a little dummy code cause TLE error.. _;
In fact, this problem don't need special technique.
Just need the highschool mathmatics... _;;
( I think the only trap of this problem is overflow...
So I add divide statement, if the current calculating result is too big )
Anyway, I got Accept. Thanks.