### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,115)
- misc (2)
- project euler (2)
- puzzle (29)
- site news (43)
- tantalizer (29)
- teaser (3)

### Site Stats

- 166,357 hits

Programming Enigma Puzzles

18 January 2016

Posted by on **From New Scientist #2340, 27th April 2002** [link]

My young nephew recently asked me to draw him a church. He gave me a sheet of A4 paper, and I began by drawing a square. I next added an isosceles triangle, using the whole of the top of the square as its base. To the whole of one side of the square I then added a rectangular nave. Of the three shapes, the rectangle occupied the largest area. The four different constituent dimensions were each a whole number of centimetres, these dimensions being the sides of each shape and the vertical height of the triangle. The areas of the three shapes added together produced a total which was perfectly divisible by each of the four dimensions.

What were the overall length and overall height of my church?

[enigma1184]

Advertisements

%d bloggers like this:

A4 paper is 210mm × 297mm. So the diagram must fit in a 21cm × 29cm rectangle.

This Python program runs in 34ms.

Solution:The overall length of the church is 18 cm. The overall height of the church is 10 cm.Here’s a scale diagram of the church:

The large dashed rectangle corresponds to the A4 sheet. The dimensions are in cm.

I also found a solution in MiniZinc. If we remove the constraint that the rectangle must be bigger than the square, there are two more cases where the arithmetic otherwise works ok.