{"raw_statement":[{"iden":"statement","content":"In this question your goal is to make a program that will simulate running some pretty basic pseudocode. Here is the syntax that will be used:\n\nDefining a variable: -\"var variableName = value\" -value can be any integer -value can be a simple math equations ex: \"3 + 5\" -value can be a simple math equation that includes a variable \"testVar + 2\"\n\nManipulating a variable: -\"variableName = value\" -same rules applied to what the value can be as the one above -Ex: \"test1 = test1 + 2 - test2\"\n\nPrinting: -\"print (hello word )+exampleVariable+\" -text that is being printed will be surrounded in parentheses -variables being printed will be surrounded in addition signs\n\nThe first line will be the number of lines of code. The next X number of lines will be the code that you need to simulate.\n\nPrint whatever the program prints.\n\n"},{"iden":"input","content":"The first line will be the number of lines of code. The next X number of lines will be the code that you need to simulate."},{"iden":"output","content":"Print whatever the program prints."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of code lines.  \nLet $ \\mathcal{V} $ be a finite map from variable names to integer values, initially empty.  \n\n**Syntax Rules**  \n1. **Variable Definition**:  \n   - Format: `var x = e`  \n   - $ e $ is an arithmetic expression over integers and existing variables in $ \\mathcal{V} $.  \n   - Evaluate $ e $ to integer $ v $, then set $ \\mathcal{V}[x] \\leftarrow v $.  \n\n2. **Variable Assignment**:  \n   - Format: `x = e`  \n   - Same evaluation rules as above; update $ \\mathcal{V}[x] \\leftarrow \\text{eval}(e) $.  \n\n3. **Print Statement**:  \n   - Format: `print (s_0) + x_1 + (s_1) + x_2 + \\dots + (s_k)`  \n   - $ s_i \\in \\mathbb{S} $ are string literals (without quotes), $ x_j \\in \\text{dom}(\\mathcal{V}) $ are variable names.  \n   - Output: Concatenation of $ s_0 $, $ \\mathcal{V}[x_1] $, $ s_1 $, $ \\mathcal{V}[x_2] $, ..., $ s_k $, with each $ \\mathcal{V}[x_j] $ converted to its decimal string representation.  \n\n**Constraints**  \n- All expressions $ e $ are well-formed arithmetic expressions using `+`, `-`, integers, and variables in $ \\mathcal{V} $.  \n- All variables in expressions are defined before use.  \n- All print statements follow the exact format with parentheses and `+` delimiters.  \n\n**Objective**  \nSimulate the $ n $ lines of code in order. For each print statement, output the resulting concatenated string.","simple_statement":"Read the number of lines of code.  \nFor each line:  \n- If it starts with \"var\", define a variable with a value (value can be number or math with numbers/variables).  \n- If it has \"=\", update the variable with a new value (value can be math with numbers/variables).  \n- If it has \"print\", extract text and variables inside parentheses and addition signs, compute the result, and print it.  \n\nExecute the code line by line and output anything that is printed.","has_page_source":false}