11298 - Dissecting a Hexagon

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

Moderator: Board moderators

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

11298 - Dissecting a Hexagon

Post by Lomir » Sun Sep 30, 2007 9:28 pm

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
else answer is 0

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

Post by Robert Gerbicz » Sun Sep 30, 2007 9:36 pm

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
else answer is 0
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

Post by baodog » Sun Sep 30, 2007 11:06 pm

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.
Sorry about this. Unfortunately, I did not get the password to post on the clarification board in time.

luishhh
New poster
Posts: 26
Joined: Mon Oct 25, 2004 8:11 pm
Location: Spain

Post by luishhh » Sun Sep 30, 2007 11:25 pm

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

Post by baodog » Sun Sep 30, 2007 11:29 pm

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:

Post by Lomir » Sun Sep 30, 2007 11:41 pm

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

Post by luishhh » Sun Sep 30, 2007 11:52 pm

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

Post by goodwill » Mon Oct 01, 2007 6:13 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:

Post by Robert Gerbicz » Mon Oct 01, 2007 6:18 am

That's good, but remember that in this problem:

Code: Select all

yes=1
no=0
And remove your spoiler!

sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo » Mon Oct 01, 2007 7:30 am

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

Post by goodwill » Mon Oct 01, 2007 12:02 pm

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.

User avatar
WingletE
New poster
Posts: 35
Joined: Sun Aug 13, 2006 1:34 pm
Location: Taipei, Taiwan
Contact:

Post by WingletE » Mon Oct 01, 2007 4:33 pm

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

Post by jah » Mon Oct 01, 2007 4:52 pm

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

Post by tobby » Mon Oct 01, 2007 6:08 pm

This task is sooo stupid :evil: :evil: 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
Location: Vancouver, BC, Canada
Contact:

Post by sclo » Mon Oct 01, 2007 7:57 pm

This problem should be fixed.

I get WA when I use cin to read input, but get AC when I use scanf
meaning there are illegal characters in the input.

Post Reply

Return to “Volume 112 (11200-11299)”