10216 - The Optimal Coffee Shop!!

Moderator: Board moderators

Even
Learning poster
Posts: 75
Joined: Thu Nov 22, 2001 2:00 am
Location: Taiwan

10216 - The Optimal Coffee Shop!!

if input like
1 2 3 or 3 4 7 that is a = b = c
what is the output ??

and can anybody give me more examples...thank you

or give me the output for

3
1 2 3
3 4 5
10000 10000 1

wyvmak
Experienced poster
Posts: 110
Joined: Thu Dec 13, 2001 2:00 am
in case you haven't got AC yet.

my output:
3.000 3.000 3.333 -1.000
6.766 6.813 6.918 7.500
10000.866 10000.914 13333.333 15000.000

Even
Learning poster
Posts: 75
Joined: Thu Nov 22, 2001 2:00 am
Location: Taiwan

><

if a,b,c can't form a triangle...should output be
-1.000 -1.000 -1.000 -1.000 ??

and how to find the DM...optimal??

I try to search from I( x, y ) ...

but I don't know if the answer is correct
( through it's correct to the sample above... )

wyvmak
Experienced poster
Posts: 110
Joined: Thu Dec 13, 2001 2:00 am
DM is called Fermat point, a search engine will tell you about it. one thing, there're two cases for Fermat point. [i'm surprised that Fermat is such a great mathematician]

if a triangle cannot be formed, only circumcentre is -1. other values still can be obtained. i think you would know what should they be.

Even
Learning poster
Posts: 75
Joined: Thu Nov 22, 2001 2:00 am
Location: Taiwan
if the input

2
123 112 12
110 100 20

what is the output ?? thank you :p

Even
Learning poster
Posts: 75
Joined: Thu Nov 22, 2001 2:00 am
Location: Taiwan
thanks.... I got AC...

124.000 125.579 156.783 440.617
119.940 121.590 141.678 182.281

arif_pasha
New poster
Posts: 42
Joined: Fri Jun 13, 2003 3:47 pm
Contact:
wyvmak wrote:if a triangle cannot be formed, only circumcentre is -1. other values still can be obtained. i think you would know what should they be.
i dont understand how the distance from the incenter can be measured.. . can anyone provide some testcases? thnx

arif_pasha
New poster
Posts: 42
Joined: Fri Jun 13, 2003 3:47 pm
Contact:
now i understand how can i find the radius of the incircle even if the points are colinear. but still wa..
can someone provide results for the following test cases:

6
1 2 3
5 5 9
100 100 100
10000 10000 1000
1000 1000 2000
10000 5000 5500

my output:
3.000 3.000 3.333 -1.000
9.974 10.381 10.569 17.206
173.205 173.205 173.205 173.205
10853.518 10892.028 13391.331 15018.785
2000.000 2000.000 2000.000 -1.000
10262.391 10940.191 11136.782 25800.942

arif_pasha
New poster
Posts: 42
Joined: Fri Jun 13, 2003 3:47 pm
Contact:
at last.. i got it accepted..

xiaomengxian
New poster
Posts: 7
Joined: Mon Mar 12, 2007 4:41 am
Location: Changsha, Hunan, China
What is the trick? Could you tell me, please?
I tried all the tests above, but still get WA..

xiaomengxian
New poster
Posts: 7
Joined: Mon Mar 12, 2007 4:41 am
Location: Changsha, Hunan, China
I've made a stupid mistake... Now I get AC

baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

Degenerate Triangles

If a>b+c, how is anything defined? You can place
the vertices arbitrarily ... and it's still not a Triangle as stated.
So -1.000 -1.000 -1.000 -1.000 if a triangle cannot
be formed at all.

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Contact:
Well, I was little bit confused for arif_pasha's cases. However, all of them are not correct I think. Here are the cases.

Input:

Code: Select all

``````11
5 5 9
1 2 3
100 100 100
10000 10000 1000
1000 1000 2000
10000 5000 5500
123 112 12
110 100 20
1 2 3
3 4 5
10000 10000 1``````
Output:

Code: Select all

``````10.000 10.381 10.569 17.206
3.000 3.000 3.333 -1.000
173.205 173.205 173.205 173.205
10853.518 10892.028 13391.331 15018.785
2000.000 2000.000 2000.000 -1.000
10500.000 10940.191 11136.782 25800.942
124.000 125.579 156.783 440.617
119.940 121.590 141.678 182.281
3.000 3.000 3.333 -1.000
6.766 6.813 6.918 7.500
10000.866 10000.914 13333.333 15000.000``````
Hope these help.
Ami ekhono shopno dekhi...
HomePage