## 10499 - The Land of Justice

Moderator: Board moderators

osan
New poster
Posts: 47
Joined: Tue Jul 29, 2003 12:03 pm
Contact:

### critical input

bery olivier you should think about critical inputs. I think you are getting WA for critical inputs.

dark man
New poster
Posts: 7
Joined: Fri Mar 26, 2004 11:07 pm
Contact:

### 10499_inputs needed

can anybody help me giving some normal & crical inputs with their outputs
of problem 10499.I don't understand what they mean with
" calculate the profit over the sold price". I solved this problem but got WA. May be i didn't understand the problem.
Try hard . May be you will get the right answer.

shamim
A great helper
Posts: 498
Joined: Mon Dec 30, 2002 10:10 am
Location: Bozeman, Montana, USA
It should be 0%.

dark man
New poster
Posts: 7
Joined: Fri Mar 26, 2004 11:07 pm
Contact:
Can anybody give the outputs of the following inputs

500
1000
200
100
50
1
21781920
10
5
-1
Try hard . May be you will get the right answer.

Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:
12500%
25000%
5000%
2500%
1250%
0%
544548000%
250%
125%

Best regards
DM
Last edited by Dominik Michniewski on Fri Apr 02, 2004 12:25 pm, edited 1 time in total.
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)

dark man
New poster
Posts: 7
Joined: Fri Mar 26, 2004 11:07 pm
Contact:
thank you dominic ,
i got some mistakes with my equation. But i have fixed it and got accepted. But i think u have done a printing mistake with the input 5.
Output should be 125%.
Try hard . May be you will get the right answer.

Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:
yes, sorry it was typo .... I corrected it ...

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)

_.B._
Experienced poster
Posts: 160
Joined: Sat Feb 07, 2004 7:50 pm
Location: Venezuela
Contact:

### 10499 > The Land of Justice > Help with formula.

Greetings!.
Will anyone please tell me what's wrong with my formula?.
Considering the graphic in the example, each Nth piece will have 2 halves of Area of a Circle, and Area of the Sphere / N.
Considering that
Area of a Circle (AC) = Pi*r^2, and
Area of the Sphere (AS) = 4*Pi*r^2 = 4*AC
[ AC = AS/4 ]
then, for each Nth piece, there will be a total Surface of:
2*(AC/2) + AS/N = AC + AS/N
For N pieces, there will be a total Surface of:
N*(AC + AS/N) = N*AC + AS
Now, for the profit:
AS -- 100%
N*AC + AS -- ?%
Therefore, Profit = [(N*AC + AS) * 100] / AS
Profit = [(N*AS/4 + AS) * 100] / AS = [AS*(N/4 + 1)*100]/AS
Profit = (N/4 + 1)*100

Profit = 25*N + 100

And that won't show the right answer
_.

little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm
No.

In this problem they want you to calculate the profit as percentage of the sell price, not the buy price. I guess the problemsetter is better in mathematics than in economics

So for the case n=2:

Sell price S = AS + 4*AC = 2*AS
Profit P = 100*(S - B)/S = 100*(2*AS - AS)/(2*AS) = 50%
As in the problem description.

In normal life the answer would be 100% because the sell price is twice the buy price, but in this case the problemsetter is king. But he could have mentioned it in the description.

_.B._
Experienced poster
Posts: 160
Joined: Sat Feb 07, 2004 7:50 pm
Location: Venezuela
Contact:

### AC!.

Greetings!.
Thanks little joey!.
Got ACed!.
Really usefull explanation.
Keep posting!.
_.

Noim
Learning poster
Posts: 88
Joined: Sun Oct 13, 2002 6:11 am
little joey,

After Accpeting this problem , i see this post and i am ashtonished. Because my accepted code calculate the profit as percentage of the buying price

and my formula almost same as _.B._ described. only differece is that _.B._ calculate the percectage of not only profit but also with it's buying price. that's the reason his all answer is 100% greater than me.

i may be used totally wrong formula. But what was the significant of your 4 time multiplication with AC of your formula little joey.
Sell price S = AS + 4*AC = 2*AS
__nOi.m....

little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm
Every time you make a cut through the sphere, the area increases by two times the area of the circle (one for every side of the cut). So cutting twice, as in the example I gave, increases the area by four times the area of the circle. If you don't believe me, take an apple and make the cuts

Noim
Learning poster
Posts: 88
Joined: Sun Oct 13, 2002 6:11 am
You are given a sequence of integers N (0 < N < 231), indicating the numbers of parts of the sphere.
does N means how many cuts or how many parts?

i think you explained it assuming N as cuts.
if n means how many parts?? then what should be the explanation?

i may still wrong.

__nOi.m....

little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm
This makes me look stupid, doesn't it? It means parts, not cuts, something I was convinced of...

Forget all of my previous postings. They are wrong. Sorry to the problemsetter. But at least _.B._ got accepted...

Noim
Learning poster
Posts: 88
Joined: Sun Oct 13, 2002 6:11 am
that does not matter boss.

yeh _.B._ have got acc for your post.....