## 11298 - Dissecting a Hexagon

Moderator: Board moderators

Lomir
New poster
Posts: 19
Joined: Mon Sep 17, 2007 10:05 pm
Contact:

### 11298 - Dissecting a Hexagon

Am i right?

If we can divede hexagon into k parallelograms. We can divide it into k+1 parallelograms by cuting any one parallelogram into 2 parallelograms for exapmle by middle.

According to the input we can't divide hexagon in 2 parallelograms, but we can divite into 3.

So:
if (n >= 3) answer is 1

Robert Gerbicz
Experienced poster
Posts: 196
Joined: Wed May 02, 2007 10:12 pm
Location: Hungary, Pest county, Halasztelek
Contact:

### Re: 11298 Dissecting a Hexagon

Lomir wrote:Am i right?

If we can divede hexagon into k parallelograms. We can divide it into k+1 parallelograms by cuting any one parallelogram into 2 parallelograms for exapmle by middle.

According to the input we can't divide hexagon in 2 parallelograms, but we can divite into 3.

So:
if (n >= 3) answer is 1
Replace the word parallelogram by rhombus!
It is a very sad thing that they can't provide a contest without errors. I've sent a clarification email about 9 hours ago but there was no answer.

baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am
It's much more general than just Rhombus.
The precise wording should be

Code: Select all

``````divide into n parallelograms of equal area.
``````
Somehow my problem tester just assumed this as I did.

luishhh
New poster
Posts: 26
Joined: Mon Oct 25, 2004 8:11 pm
Location: Spain
Are they parellelograms or rhombus? I honestly find your post confusing

EDIT: I got AC considering Parellelograms not neccesarily Rhombus, so forget the word Rhombus! Moreover there is a test case with n <= 0, could anybody explain me why there are such stupid cases?
Last edited by luishhh on Sun Sep 30, 2007 11:34 pm, edited 1 time in total.
"From lost to the river" --> Spanish quote

baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am
Both interpretations (although different).
lead you to the same output as the judge:

1) n Parallelogram, each with all sides equal.

2) n Parallelograms with equal area.

Lomir
New poster
Posts: 19
Joined: Mon Sep 17, 2007 10:05 pm
Contact:
baodog wrote:Both interpretations (although different).
lead you to the same output as the judge:

1) n Parallelogram, each with all sides equal.

2) n Parallelograms with equal area.
According to the probmes statement i can find any parallelograms. Please fix it.

P.S. Solved different size rombus problem... Now will try once again to solve it...

luishhh
New poster
Posts: 26
Joined: Mon Oct 25, 2004 8:11 pm
Location: Spain
1) n Parallelogram, each with all sides equal.

2) n Parallelograms with equal area.
I got AC using the second hypothesis. So, if both are equivalent in this problem, please tell me how to dissect a hexagon in 6 rhombus with all equal sides, I don't find the solution.
"From lost to the river" --> Spanish quote

goodwill
New poster
Posts: 25
Joined: Mon Sep 03, 2007 10:54 am
AC now after using string to read input!!!
Last edited by goodwill on Mon Oct 01, 2007 12:04 pm, edited 2 times in total.

Robert Gerbicz
Experienced poster
Posts: 196
Joined: Wed May 02, 2007 10:12 pm
Location: Hungary, Pest county, Halasztelek
Contact:
That's good, but remember that in this problem:

Code: Select all

``````yes=1
no=0``````

sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Contact:
Is it possible to dissect if n is not a multiple of 3?

goodwill
New poster
Posts: 25
Joined: Mon Sep 03, 2007 10:54 am
I read a paper and it said that :
For a n-gon (n>=5), there is no way to dissect it into m triangles with equal area with gcd(n,m)=1.

WingletE
New poster
Posts: 35
Joined: Sun Aug 13, 2006 1:34 pm
Location: Taipei, Taiwan
Contact:
I can't think of any cases that n is not a multiple of 3 when the output is 1.
If it's really possible, could somebody give an example?

jah
New poster
Posts: 38
Joined: Wed Apr 20, 2005 12:23 am
There is a test case

Code: Select all

``````Input
0

Output
0
``````
I don't know why but I finally got AC after taking care of this exception.
So the matter is that there is no way of dissecting an hexagon in 0 parallelograms ...
Last edited by jah on Mon Oct 01, 2007 7:46 pm, edited 1 time in total.

tobby
Learning poster
Posts: 98
Joined: Fri Dec 30, 2005 3:31 pm
This task is sooo stupid There are some invalid characters other than spaces and digits, probably tabs. If you use PASCAL, you will need some special routines to parse the input (otherwise you get Runtime Error with no apparent reason). But if you use C or C++, you will not face any problem using scanf. This is pretty unfair.

sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm