Lord_Farin, thanks for the explanation. I am somehow still not convinced. Put it differently two solid objects can occupy the same point as per this definition if they are adjacent.Lord_Farin wrote:You may want to notice that the volume of a cuboid is not the same as the amount of lattice points contained in it. That is what led to your confusion, I believe. Since planes have volume zero in 3D, it does not matter if we include the boundary of the cuboid or not: the volume stays the same.

## Problem 212

**Forum rules**

As your posts will be visible to the general public you

are requested to be thoughtful in not posting anything

that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one

See also the topics:

Don't post any spoilers

Comments, questions and clarifications about PE problems.

### Re: Problem 212

puzzle is a euphemism for lack of clarity

### Re: Problem 212

Sure they can - there is a lot of overlapping of cuboids in this problem, which is the point (to calculate the volume of the union). The problem doesn't say the cuboids can't share points (in fact, if they couldn't, the problem would be trivial, since you'd just add the volumes of each cuboid).

If you were asked to draw a lot of squares on a piece of paper then calculate the area of the union, it doesn't make a difference whether you include the edges or not - the area is the same. And there will definitely be squares sharing the same points. Exactly the same here, but with cuboids.

If you were asked to draw a lot of squares on a piece of paper then calculate the area of the union, it doesn't make a difference whether you include the edges or not - the area is the same. And there will definitely be squares sharing the same points. Exactly the same here, but with cuboids.

### Re: Problem 212

Thanks Guys, working on a problem till late into the night can make you dumb .

puzzle is a euphemism for lack of clarity

### Re: Problem 212

I've figured out an algorithm for this problem, and the code I wrote gives the correct answer for n=100 and for n=1579 that was provided earlier in this thread, but it gives the wrong answer for the full n=50000 problem. Could I message someone here with some other values, just to see if I can figure out where I'm going wrong?

### Re: Problem 212

Nevermind, I figured out what I was doing wrong and I've solved it now

### Re: Problem 212

Don't know if this is OK to ask, but can this be done in better than $O(n^2)$?