## 616 - Coconuts, Revisited

All about problems in Volume 6. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

jjtse
Learning poster
Posts: 80
Joined: Mon Aug 22, 2005 7:32 pm
Contact:
are you sure there is no solution for this case?

65539

My program output says 2 people and 1 monkey.

My program is not AC

jjtse
Learning poster
Posts: 80
Joined: Mon Aug 22, 2005 7:32 pm
Contact:
Hi,

I'm wondering if someone can give some more sample inputs/output for this problem. I think my program is pretty good except maybe a few special cases.

Thanks

jjtse
Learning poster
Posts: 80
Joined: Mon Aug 22, 2005 7:32 pm
Contact:
ram wrote:"long int" is not sufficient for longer values.

Try using "long double" instead of "long int" and "fmod" instead of "%".

Why would that even be an issue? The problem clearly says "integers" as coconuts

mf
Guru
Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:
jjtse wrote:65539

My program output says 2 people and 1 monkey.

My program is not AC
My program was accepted, and it also says 2 people, 1 monkey.
jjtse, in http://online-judge.uva.es/board/viewtopic.php?t=104 wrote:
ram wrote:"long int" is not sufficient for longer values.

Try using "long double" instead of "long int" and "fmod" instead of "%".
Why would that even be an issue? The problem clearly says "integers" as coconuts
You know, googolplex is an integer, too
So, can you tell me what is the output for it?

little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm
mf wrote:You know, googolplex is an integer, too
So, can you tell me what is the output for it?
"That was a hell of a lot of coconuts for one monkey (burp!); next time I'll stick to bananas!"

hi!man!
New poster
Posts: 48
Joined: Fri Dec 29, 2006 1:26 pm
Andrey Mokhov wrote:Well you know I was lazy enough to calculate the higher limit of n, but it's clear for me that n=30 is enough. Of course it may be even too much, but I don't want to improve the limit.

Best regards.
n = 9 is enough.

brett1479
New poster
Posts: 4
Joined: Tue Nov 12, 2013 4:57 pm

### Re: 616 - Coconuts, Revisited

The input test data for this problem is very weak. There are no test cases where the number of people is greater than 5.

ashik_53@diu
New poster
Posts: 1
Joined: Mon Dec 28, 2015 10:20 pm

### Re: 616 - Coconuts, Revisited

check your program with input 3 . AC Output is 3 coconuts, 2 people and 1 monkey