1725

Problem ID: 1725

From Quadtree problem: With the Quadtree system, secret pictures (like treasure maps) are encoded in the following way: If the whole picture is black, it is encoded by the letter B. If it is completely white, it is encoded by W. If both colors are used (what is usually the case), it is encoded by Qxxxx where each x is a string that recursively encoded one quarter of the picture (in the order top left, top right, bottom left, bottom right). As the Aztecs always uses quadratic pictures with n*n pixels where n is a power of two, this method always works perfectly. A 2*2 chess board, for instance, would be encoded as QWBBW, a 4*4 chess board as QQWBBWQWBBWQWBBWQWBBW.