PROJECT EULER · #0907
Stacking Cups
An infant's toy consists of
The cups may be stacked in various combinations and orientations to form towers. The cups are shaped such that the following means of stacking are possible:
- Nesting:
may sit snugly inside .
- Base-to-base:
or may sit, right-way-up, on top of an up-side-down , with their bottoms fitting together snugly.
- Rim-to-rim:
or may sit, up-side-down, on top of a right-way-up , with their tops fitting together snugly.
- For the purposes of this problem, it is not permitted to stack both
and rim-to-rim on top of , despite the schematic diagrams appearing to allow it:

Define
You are given
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.