1 / 3
Jan 2005

I must say that I think the problem description is extremely misleading for this problem. It says, the rectangle should have horizontal and vertical edges, but I got a lot of WA when I ensured that the output area is >0, and accepted if I also printed 0 if that was possible. But how can a side with length 0 be seen as horizontal or vertical?

  • created

    Jan '05
  • last reply

    Jan '05
  • 2

    replies

  • 658

    views

  • 2

    users

I dare say that for me a point is both a horizontal and a vertical segment... Perhaps you are right that this isn't perfectly obvious, but I can't see any definition of a horizontal/vertical closed segment that would assume otherwise (unless you choose to specify explicitly that a segment must have positive length?).

Another thing, the area of a rectangle is a real number, not an integer (only the particular value we are looking for happens to be an integer). The infimum of the set of possible areas is most certainly 0, so no answer other than 0 can ever be considered. The question whether the word 'smallest' is legal in this context depends on the definition of a segment. If you think it is objectionable I can change it to infimum wink.

Ok, now I see that my problem was that I thought the segments have to lie on some integer values, which is not said in the problem description. Therefore as you say the infimum of the area is 0.