# A computer science problem by Rocco Dalto

Computer Science Level pending

Let $$+$$ , $$*$$, $$-$$, and $$\div$$ be operations of addition, multiplication, subtraction, and division of integers, respectively.

$$\lfloor I - AM * NOT \div A + LIAR \rfloor = TRUE$$

In the cryptogram shown above each letter represents a digit. Let $$a_{1}$$ be the maximum value for $$\overline{TRUE}$$, $$b_{1}$$ be the minimum value for $$\overline{TRUE}$$ and $$n_{1}$$ be all possible values of $$\: \lfloor \overline{I} - \overline{AM} * \overline{NOT} \div \overline{A} + \overline{LIAR}\rfloor = \overline{TRUE}$$ and $$m_{1} = a_{1} - b_{1} + n_{1}$$.

$$\lfloor I * AM - NOT \div A + LAZY \rfloor = LADY$$

In the second cryptogram shown above each letter represents a digit. Let $$a_{2}$$ be the maximum value for $$\overline{LADY}$$, $$b_{2}$$ be the minimum value for $$\overline{LADY}$$ and $$n_{2}$$ be all possible values of $$\: \lfloor \overline{I} * \overline{AM} - \overline{NOT} \div \overline{A} + \overline{LAZY}\rfloor = \overline{LADY}$$ and $$m_{2} = a_{2} - b_{2} + n_{2}$$.

Find: $$m_{1} + m_{2}.$$

Note: You can create a program (in any language) to find $$m_{1}$$ and $$m_{2}.$$ 

I wrote a program $$A$$ that when executed gets the input and writes a program $$B$$ to solve cryptograms to a text file, then I saved the text file using a different extension, complied it and ran program $$B$$. 

So, for the first cryptogram you would just need to run program $$A$$ and save the text file (using a different extension) containing program $$B_{1}$$ and execute it, then for the second cryptogram run program $$A$$ again and save the text file(using a different extension) containing program $$B_{2}$$ and execute it.



I chose two cryptograms so that program $$A$$ can generate the two cryptograms as stated above. Writing two separate programs for each cryptogram would be tedious and that was not my intention. Essential, you just need to write program $$A$$. 

Assume I chose $$N$$ cryptograms. Write program $$A$$ to generate all $$N$$ cryptograms as stated above.



×