Company: Amex_7aug
Difficulty: medium
Domino Pyramid Problem Description John has found six dominoes. Each domino is a rectangular tile split by a line into two square halves, and each half shows a number of spots. John wants to stack all six dominoes into a pyramid with three levels: the bottom level holds three dominoes laid end to end in a row, the middle level holds two dominoes, the top level holds one domino. Every domino lies horizontally, and each level is centred over the level below it. Because a domino is two halves wide, every domino on an upper level rests on two dominoes below it: its left half sits on the right half of one domino, and its right half sits on the left half of the next one. Numbering the halves of each level from left to right: top level: [ T1 | T2 ] middle level: [ M1 | M2 ] [ M3 | M4 ] bottom level: [ B1 | B2 ] [ B3 | B4 ] [ B5 | B6 ] The pyramid is valid only if every half that has a half directly beneath it shows the same number of spots as that half : M1 = B2 , M2 = B3 , M3 = B4 , M4 = B5