• 如果您觉得本站非常有看点，那么赶紧使用Ctrl+D 收藏吧

# 蓝桥杯 省赛 试题 D: REPEAT 程序 多种解法（替换/正则）

1周前 (10-17) 13次浏览

## 试题 D: REPEAT 程序

大家好，我叫亓官劼（qí guān jié ），在CSDN中记录学习的点滴历程，时光荏苒，未来可期，加油~博主目前仅在CSDN中写博客，唯一博客更新的地址为：亓官劼的博客

【问题描述】

REPEAT 2:

A = A + 4

REPEAT 5:

REPEAT 6:

A = A + 5

A = A + 7

A = A + 8

A = A + 9

REPEAT 6: 所在的行到 A = A + 7 所在的行都在 REPEAT 5: 循环中。

A = A + 5 实际总共的循环次数是 2 × 5 × 6 = 60 次。

【答案提交】

## 试题D 题解一：转换

``````dir = '/Users/qiguan/Downloads/C++大学B组/REPEAT程序.txt'
file = open(dir)
data = file.read()
len = data.__len__()

def get_indent(i):
now_indent = 0
while data[i] == ' ':
now_indent = now_indent + 1
i = i + 1
return now_indent, i

def get_flag(i):
if data[i] == 'R':
i = i + 7
return 1, i
if data[i] == 'A':
i = i + 8
return 2, i

# 当前处理中的行前缩进空格数
indent = 0
# 控制下标
i = 5
# A的值
A = 0
# 乘数
multiplier =  1
# 乘数 集合
multiplier_list = []
flag = 0
while i != len:
if data[i] == 'n':
i = i + 1
if i >= len -1:
break
now_indent, i = get_indent(i)
flag, i = get_flag(i)
if now_indent < indent:
multiplier /= multiplier_list[-1]
multiplier_list.pop()
if flag == 1:
multiplier *= int(data[i])
multiplier_list.append(int(data[i]))
i += 2
# A = A +
if flag == 2:
A += int(data[i])*multiplier
i += 1
indent = now_indent
print(A)

``````

## 解法二：正则替换

``````a = re.sub("        REPEAT ","        for k in range(",a)
a = re.sub(":","):",a)
a = re.sub("    REPEAT ","    for j in range(",a)
a = re.sub("REPEAT ","for i in range(",a)

print(a)
``````

``````import re
a = """
A = 0
REPEAT 2:
A = A + 4
REPEAT 5:
REPEAT 6:
A = A + 5
A = A + 7
REPEAT 6:
A = A + 7
REPEAT 4:
A = A + 2
A = A + 7
A = A + 2
REPEAT 7:
REPEAT 4:
A = A + 8
A = A + 7
A = A + 4
A = A + 5
A = A + 8
REPEAT 8:
A = A + 5
REPEAT 1:
A = A + 2
REPEAT 7:
A = A + 5
A = A + 5
REPEAT 2:
REPEAT 3:
A = A + 1
A = A + 1
REPEAT 5:
A = A + 1
REPEAT 9:
REPEAT 6:
A = A + 5
A = A + 1
REPEAT 6:
A = A + 2
A = A + 8
A = A + 3
REPEAT 2:
A = A + 5
REPEAT 3:
A = A + 9
REPEAT 1:
A = A + 4
REPEAT 2:
A = A + 9
REPEAT 1:
A = A + 6
A = A + 6
A = A + 4
REPEAT 3:
A = A + 7
A = A + 1
REPEAT 2:
A = A + 3
REPEAT 5:
A = A + 2
A = A + 5
A = A + 2
A = A + 4
A = A + 3
REPEAT 4:
A = A + 4
A = A + 3
A = A + 7
REPEAT 5:
REPEAT 4:
A = A + 5
A = A + 7
REPEAT 5:
A = A + 3
REPEAT 3:
A = A + 3
A = A + 1
A = A + 8
A = A + 2
REPEAT 9:
A = A + 5
REPEAT 1:
A = A + 5
A = A + 2
A = A + 8
A = A + 6
REPEAT 3:
REPEAT 4:
A = A + 9
REPEAT 5:
A = A + 2
A = A + 1
REPEAT 9:
A = A + 9
A = A + 2
REPEAT 1:
A = A + 6
A = A + 8
REPEAT 2:
A = A + 9
A = A + 4
A = A + 7
REPEAT 2:
REPEAT 7:
A = A + 3
A = A + 5
REPEAT 3:
A = A + 5
A = A + 3
A = A + 6
A = A + 4
REPEAT 9:
A = A + 2
A = A + 8
A = A + 2
A = A + 3
REPEAT 2:
REPEAT 8:
A = A + 5
A = A + 1
A = A + 6
A = A + 1
A = A + 2
REPEAT 6:
REPEAT 1:
A = A + 3
REPEAT 1:
A = A + 2
REPEAT 4:
A = A + 7
A = A + 1
A = A + 8
REPEAT 6:
A = A + 5
REPEAT 6:
A = A + 3
REPEAT 2:
A = A + 2
A = A + 9
A = A + 7
REPEAT 9:
A = A + 8
REPEAT 9:
A = A + 8
A = A + 9
A = A + 3
A = A + 2
REPEAT 6:
A = A + 3
REPEAT 9:
A = A + 1
A = A + 9
A = A + 5
REPEAT 2:
A = A + 4
A = A + 9
A = A + 8
REPEAT 5:
A = A + 6
A = A + 9
A = A + 1
REPEAT 1:
A = A + 4
A = A + 2
REPEAT 9:
REPEAT 3:
A = A + 4
REPEAT 7:
A = A + 8
A = A + 3
REPEAT 5:
A = A + 9
REPEAT 8:
A = A + 9
A = A + 8
REPEAT 4:
A = A + 7
A = A + 7
A = A + 3
A = A + 5
REPEAT 6:
A = A + 7
REPEAT 7:
A = A + 2
A = A + 2
A = A + 1
REPEAT 8:
REPEAT 1:
REPEAT 4:
A = A + 6
A = A + 6
A = A + 2
REPEAT 5:
A = A + 4
A = A + 8
A = A + 4
REPEAT 1:
A = A + 5
REPEAT 7:
A = A + 8
REPEAT 6:
A = A + 4
A = A + 4
A = A + 8
REPEAT 4:
A = A + 2
REPEAT 2:
A = A + 4
REPEAT 2:
A = A + 3
REPEAT 1:
A = A + 2
A = A + 8
REPEAT 2:
A = A + 7
REPEAT 8:
A = A + 6
A = A + 1
A = A + 7
REPEAT 8:
A = A + 2
REPEAT 8:
REPEAT 6:
A = A + 1
A = A + 6
REPEAT 2:
A = A + 4
A = A + 1
A = A + 7
A = A + 4
REPEAT 4:
REPEAT 9:
A = A + 2
REPEAT 1:
A = A + 2
A = A + 5
REPEAT 8:
REPEAT 6:
A = A + 3
REPEAT 4:
A = A + 1
A = A + 6
A = A + 1
REPEAT 7:
A = A + 7
REPEAT 7:
A = A + 3
A = A + 9
A = A + 1
A = A + 9
REPEAT 3:
A = A + 5
A = A + 5
A = A + 6
A = A + 2
REPEAT 1:
A = A + 4
REPEAT 2:
A = A + 7
REPEAT 1:
A = A + 7
REPEAT 4:
A = A + 7
A = A + 2
REPEAT 5:
A = A + 9
A = A + 1
A = A + 9
A = A + 5
A = A + 9
REPEAT 5:
A = A + 5
REPEAT 1:
A = A + 6
REPEAT 2:
A = A + 3
A = A + 2
A = A + 6
A = A + 8
A = A + 8
A = A + 7
A = A + 5
A = A + 5
REPEAT 2:
A = A + 1
A = A + 7
A = A + 3
REPEAT 2:
A = A + 7
A = A + 1
A = A + 4
REPEAT 1:
REPEAT 7:
REPEAT 2:
A = A + 3
A = A + 5
A = A + 2
A = A + 6
A = A + 1
A = A + 2
A = A + 4
A = A + 9
REPEAT 1:
A = A + 8
REPEAT 8:
REPEAT 4:
REPEAT 8:
A = A + 4
REPEAT 3:
A = A + 1
A = A + 8
REPEAT 7:
A = A + 8
REPEAT 7:
A = A + 7
A = A + 7
REPEAT 7:
A = A + 6
REPEAT 5:
A = A + 9
A = A + 3
REPEAT 4:
A = A + 5
A = A + 5
A = A + 4
REPEAT 9:
REPEAT 3:
A = A + 4
A = A + 3
A = A + 6
REPEAT 1:
A = A + 3
A = A + 3
A = A + 6
REPEAT 6:
A = A + 7
A = A + 7
A = A + 5
A = A + 5
A = A + 1
A = A + 2
A = A + 6
A = A + 6
REPEAT 9:
A = A + 6
REPEAT 1:
REPEAT 2:
A = A + 4
A = A + 7
REPEAT 3:
A = A + 6
REPEAT 5:
A = A + 3
A = A + 6
REPEAT 9:
A = A + 3
A = A + 6
REPEAT 5:
A = A + 8
A = A + 8
REPEAT 3:
A = A + 7
A = A + 9
A = A + 8
A = A + 3
A = A + 3
A = A + 9
REPEAT 6:
A = A + 9
A = A + 1
REPEAT 4:
REPEAT 1:
A = A + 7
REPEAT 9:
A = A + 2
A = A + 9
A = A + 1
A = A + 2
A = A + 8
A = A + 7
A = A + 9
A = A + 6
REPEAT 4:
REPEAT 2:
A = A + 3
REPEAT 3:
A = A + 4
A = A + 4
REPEAT 6:
A = A + 6
A = A + 1
A = A + 5
A = A + 8
REPEAT 2:
A = A + 6
REPEAT 1:
REPEAT 2:
A = A + 2
REPEAT 3:
A = A + 1
REPEAT 1:
A = A + 8
A = A + 7
A = A + 4
A = A + 2
A = A + 8
A = A + 4
REPEAT 5:
REPEAT 6:
A = A + 8
REPEAT 9:
A = A + 5
A = A + 5
REPEAT 5:
A = A + 5
REPEAT 3:
REPEAT 5:
A = A + 4
REPEAT 4:
A = A + 6
A = A + 3
REPEAT 7:
A = A + 3
A = A + 3
A = A + 1
A = A + 7
A = A + 7
A = A + 6
A = A + 5
A = A + 5
A = A + 6
REPEAT 1:
A = A + 9
A = A + 3
REPEAT 1:
REPEAT 1:
A = A + 1
REPEAT 8:
A = A + 5
REPEAT 8:
A = A + 6
REPEAT 4:
A = A + 9
A = A + 4
REPEAT 2:
A = A + 3
A = A + 7
REPEAT 5:
A = A + 7
A = A + 5
A = A + 8
A = A + 7
A = A + 8
A = A + 5
REPEAT 2:
A = A + 5
A = A + 7
A = A + 8
A = A + 5
A = A + 9
REPEAT 2:
REPEAT 6:
A = A + 9
A = A + 1
A = A + 8
A = A + 7
A = A + 1
A = A + 5
REPEAT 3:
A = A + 3
A = A + 9
A = A + 7
REPEAT 3:
A = A + 9
A = A + 1
REPEAT 6:
A = A + 1
REPEAT 9:
REPEAT 7:
A = A + 3
REPEAT 5:
A = A + 5
A = A + 8
A = A + 8
A = A + 1
A = A + 2
REPEAT 4:
A = A + 6
REPEAT 3:
A = A + 3
A = A + 7
REPEAT 8:
REPEAT 1:
A = A + 7
A = A + 8
A = A + 3
A = A + 1
A = A + 2
A = A + 4
A = A + 7
REPEAT 1:
REPEAT 1:
REPEAT 1:
A = A + 4
A = A + 6
REPEAT 1:
A = A + 3
A = A + 9
A = A + 6
REPEAT 9:
A = A + 1
A = A + 6
REPEAT 5:
A = A + 3
A = A + 9
A = A + 5
A = A + 5
A = A + 7
A = A + 2
REPEAT 2:
A = A + 7
A = A + 7
REPEAT 7:
REPEAT 4:
A = A + 6
A = A + 8
REPEAT 6:
A = A + 6
REPEAT 2:
A = A + 1
A = A + 7
A = A + 6
A = A + 7
REPEAT 4:
REPEAT 7:
A = A + 1
REPEAT 2:
A = A + 2
A = A + 5
A = A + 8
A = A + 2
A = A + 1
A = A + 4
REPEAT 8:
A = A + 5
A = A + 6
REPEAT 7:
REPEAT 6:
REPEAT 9:
A = A + 7
A = A + 8
REPEAT 4:
A = A + 6
A = A + 4
A = A + 3
A = A + 6
REPEAT 9:
A = A + 3
REPEAT 9:
A = A + 2
A = A + 7
A = A + 5
A = A + 2
REPEAT 7:
REPEAT 8:
REPEAT 6:
A = A + 4
A = A + 9
A = A + 5
A = A + 3
A = A + 9
REPEAT 4:
REPEAT 1:
A = A + 6
A = A + 8
REPEAT 1:
A = A + 6
A = A + 4
A = A + 6
REPEAT 3:
A = A + 7
REPEAT 3:
A = A + 4
A = A + 4
A = A + 2
A = A + 3
A = A + 7
REPEAT 5:
A = A + 6
A = A + 5
REPEAT 1:
REPEAT 8:
A = A + 5
REPEAT 3:
A = A + 6
REPEAT 9:
A = A + 4
A = A + 3
REPEAT 6:
REPEAT 2:
A = A + 1
A = A + 5
A = A + 2
A = A + 2
A = A + 7
REPEAT 4:
A = A + 7
A = A + 9
A = A + 2
REPEAT 8:
A = A + 9
REPEAT 9:
REPEAT 2:
A = A + 3
A = A + 2
A = A + 1
A = A + 5
REPEAT 9:
A = A + 1
A = A + 3
A = A + 9
REPEAT 7:
A = A + 2
REPEAT 5:
A = A + 9
A = A + 3
REPEAT 2:
A = A + 4
REPEAT 8:
A = A + 9
REPEAT 5:
A = A + 5
A = A + 4
A = A + 2
A = A + 4
REPEAT 6:
A = A + 2
REPEAT 5:
A = A + 7
A = A + 7
A = A + 8
A = A + 3
REPEAT 8:
A = A + 2
A = A + 5
REPEAT 1:
A = A + 8
A = A + 5
A = A + 1
A = A + 1
A = A + 5
REPEAT 2:
A = A + 6
REPEAT 6:
A = A + 9
A = A + 2
A = A + 5
REPEAT 4:
A = A + 7
A = A + 1
REPEAT 6:
A = A + 8
A = A + 4
REPEAT 3:
REPEAT 2:
A = A + 1
A = A + 5
REPEAT 2:
A = A + 7
REPEAT 9:
A = A + 6
A = A + 8
A = A + 9
A = A + 5
REPEAT 9:
REPEAT 3:
A = A + 7
A = A + 7
A = A + 9
A = A + 7
REPEAT 5:
A = A + 7
A = A + 2
A = A + 1
A = A + 8
A = A + 3
A = A + 5
A = A + 1
REPEAT 8:
A = A + 4
A = A + 2
A = A + 2
A = A + 8
REPEAT 4:
REPEAT 4:
A = A + 8
REPEAT 7:
A = A + 5
A = A + 2
REPEAT 2:
A = A + 6
REPEAT 4:
A = A + 8
A = A + 6
A = A + 1
A = A + 3
A = A + 2
A = A + 7
A = A + 4
REPEAT 8:
A = A + 2
A = A + 4
REPEAT 5:
REPEAT 3:
REPEAT 6:
A = A + 8
A = A + 1
A = A + 6
A = A + 5
A = A + 9
REPEAT 8:
A = A + 7
REPEAT 6:
A = A + 4
A = A + 5
REPEAT 3:
A = A + 1
REPEAT 1:
REPEAT 5:
A = A + 6
A = A + 2
REPEAT 9:
REPEAT 5:
A = A + 9
A = A + 3
REPEAT 9:
A = A + 9
A = A + 8
REPEAT 8:
REPEAT 5:
A = A + 9
A = A + 4
REPEAT 9:
A = A + 3
A = A + 4
A = A + 5
REPEAT 9:
REPEAT 7:
A = A + 5
REPEAT 3:
A = A + 7
REPEAT 9:
REPEAT 6:
A = A + 4
A = A + 6
REPEAT 5:
REPEAT 6:
A = A + 5
A = A + 3
A = A + 3
A = A + 3
A = A + 5
REPEAT 7:
A = A + 5
REPEAT 2:
A = A + 5
A = A + 6
REPEAT 2:
A = A + 2
A = A + 5
A = A + 3
A = A + 5
A = A + 5
REPEAT 4:
A = A + 2
A = A + 1
REPEAT 9:
A = A + 9
A = A + 5
A = A + 6
A = A + 2
A = A + 2
A = A + 5
REPEAT 9:
A = A + 5
A = A + 4
REPEAT 4:
REPEAT 4:
A = A + 1
A = A + 2
REPEAT 6:
A = A + 9
A = A + 3
REPEAT 2:
A = A + 5
A = A + 1
A = A + 1
A = A + 3
A = A + 8
REPEAT 7:
A = A + 4
REPEAT 6:
A = A + 9
REPEAT 5:
A = A + 9
A = A + 8
A = A + 3
A = A + 9
A = A + 4
A = A + 6
REPEAT 7:
A = A + 9
REPEAT 9:
A = A + 4
A = A + 9
A = A + 1
A = A + 3
REPEAT 5:
REPEAT 1:
A = A + 4
A = A + 4
REPEAT 8:
A = A + 9
A = A + 6
A = A + 2
REPEAT 3:
A = A + 4
A = A + 4
REPEAT 3:
A = A + 5
A = A + 2
A = A + 8
A = A + 3
A = A + 6
A = A + 4
A = A + 9
A = A + 1
A = A + 9
A = A + 5
A = A + 3
REPEAT 3:
A = A + 2
A = A + 5
A = A + 8
A = A + 2
A = A + 5
REPEAT 8:
REPEAT 2:
A = A + 6
A = A + 7
A = A + 6
A = A + 9
A = A + 2
REPEAT 2:
A = A + 3
REPEAT 8:
A = A + 7
A = A + 2
A = A + 1
A = A + 4
A = A + 1
A = A + 5
A = A + 2
A = A + 1
REPEAT 1:
A = A + 1
REPEAT 6:
A = A + 4
A = A + 3
A = A + 3
REPEAT 5:
A = A + 3
REPEAT 6:
REPEAT 1:
A = A + 5
A = A + 7
A = A + 7
A = A + 7
REPEAT 5:
A = A + 9
A = A + 7
REPEAT 5:
A = A + 9
A = A + 1
A = A + 9
A = A + 8
REPEAT 1:
A = A + 2
REPEAT 5:
A = A + 8
REPEAT 3:
A = A + 2
A = A + 9
A = A + 6
A = A + 3
REPEAT 5:
REPEAT 6:
A = A + 5
A = A + 5
REPEAT 4:
A = A + 5
A = A + 4
REPEAT 8:
A = A + 9
A = A + 1
REPEAT 8:
A = A + 8
A = A + 1
A = A + 4
REPEAT 6:
A = A + 6
REPEAT 2:
A = A + 3
A = A + 9
A = A + 6
A = A + 9
REPEAT 1:
A = A + 4
REPEAT 3:
A = A + 3
A = A + 4
A = A + 2
A = A + 8
REPEAT 2:
A = A + 4
A = A + 1
REPEAT 9:
A = A + 2
A = A + 9
A = A + 7
REPEAT 7:
REPEAT 7:
REPEAT 5:
A = A + 7
REPEAT 5:
A = A + 1
A = A + 1
REPEAT 5:
A = A + 6
REPEAT 1:
A = A + 4
REPEAT 9:
A = A + 4
A = A + 1
REPEAT 6:
A = A + 8
A = A + 5
REPEAT 1:
A = A + 4
REPEAT 5:
A = A + 8
A = A + 7
A = A + 2
REPEAT 3:
A = A + 3
REPEAT 8:
REPEAT 8:
A = A + 4
A = A + 7
REPEAT 5:
A = A + 1
REPEAT 8:
A = A + 7
A = A + 8
A = A + 4
A = A + 7
A = A + 6
A = A + 9
A = A + 5
REPEAT 3:
A = A + 5
REPEAT 9:
A = A + 1
A = A + 7
REPEAT 1:
A = A + 8
A = A + 4
REPEAT 8:
REPEAT 7:
A = A + 2
REPEAT 4:
A = A + 6
A = A + 6
REPEAT 1:
A = A + 7
A = A + 1
REPEAT 9:
REPEAT 5:
A = A + 6
A = A + 5
REPEAT 7:
A = A + 3
A = A + 6
A = A + 8
REPEAT 2:
A = A + 7
A = A + 1
A = A + 9
REPEAT 3:
REPEAT 3:
A = A + 5
"""
a = re.sub("        REPEAT ","        for k in range(",a)
a = re.sub(":","):",a)
a = re.sub("    REPEAT ","    for j in range(",a)
a = re.sub("REPEAT ","for i in range(",a)

print(a)
``````

``````A = 0
for i in range(2):
A = A + 4
for j in range(5):
for k in range(6):
A = A + 5
A = A + 7
for j in range(6):
A = A + 7
for k in range(4):
A = A + 2
A = A + 7
A = A + 2
for j in range(7):
for k in range(4):
A = A + 8
A = A + 7
A = A + 4
A = A + 5
A = A + 8
for j in range(8):
A = A + 5
for k in range(1):
A = A + 2
for k in range(7):
A = A + 5
A = A + 5
for j in range(2):
for k in range(3):
A = A + 1
A = A + 1
for j in range(5):
A = A + 1
for j in range(9):
for k in range(6):
A = A + 5
A = A + 1
for k in range(6):
A = A + 2
A = A + 8
A = A + 3
for k in range(2):
A = A + 5
for k in range(3):
A = A + 9
for k in range(1):
A = A + 4
for k in range(2):
A = A + 9
for k in range(1):
A = A + 6
A = A + 6
A = A + 4
for k in range(3):
A = A + 7
A = A + 1
for k in range(2):
A = A + 3
for k in range(5):
A = A + 2
A = A + 5
A = A + 2
A = A + 4
A = A + 3
for i in range(4):
A = A + 4
A = A + 3
A = A + 7
for j in range(5):
for k in range(4):
A = A + 5
A = A + 7
for k in range(5):
A = A + 3
for k in range(3):
A = A + 3
A = A + 1
A = A + 8
A = A + 2
for k in range(9):
A = A + 5
for k in range(1):
A = A + 5
A = A + 2
A = A + 8
A = A + 6
for i in range(3):
for j in range(4):
A = A + 9
for k in range(5):
A = A + 2
A = A + 1
for j in range(9):
A = A + 9
A = A + 2
for k in range(1):
A = A + 6
A = A + 8
for k in range(2):
A = A + 9
A = A + 4
A = A + 7
for j in range(2):
for k in range(7):
A = A + 3
A = A + 5
for k in range(3):
A = A + 5
A = A + 3
A = A + 6
A = A + 4
for k in range(9):
A = A + 2
A = A + 8
A = A + 2
A = A + 3
for j in range(2):
for k in range(8):
A = A + 5
A = A + 1
A = A + 6
A = A + 1
A = A + 2
for j in range(6):
for k in range(1):
A = A + 3
for k in range(1):
A = A + 2
for k in range(4):
A = A + 7
A = A + 1
A = A + 8
for k in range(6):
A = A + 5
for k in range(6):
A = A + 3
for k in range(2):
A = A + 2
A = A + 9
A = A + 7
for j in range(9):
A = A + 8
for k in range(9):
A = A + 8
A = A + 9
A = A + 3
A = A + 2
for k in range(6):
A = A + 3
for k in range(9):
A = A + 1
A = A + 9
A = A + 5
for k in range(2):
A = A + 4
A = A + 9
A = A + 8
for k in range(5):
A = A + 6
A = A + 9
A = A + 1
for j in range(1):
A = A + 4
A = A + 2
for j in range(9):
for k in range(3):
A = A + 4
for k in range(7):
A = A + 8
A = A + 3
for k in range(5):
A = A + 9
for k in range(8):
A = A + 9
A = A + 8
for k in range(4):
A = A + 7
A = A + 7
A = A + 3
A = A + 5
for i in range(6):
A = A + 7
for i in range(7):
A = A + 2
A = A + 2
A = A + 1
for i in range(8):
for j in range(1):
for k in range(4):
A = A + 6
A = A + 6
A = A + 2
for k in range(5):
A = A + 4
A = A + 8
A = A + 4
for k in range(1):
A = A + 5
for k in range(7):
A = A + 8
for k in range(6):
A = A + 4
A = A + 4
A = A + 8
for k in range(4):
A = A + 2
for k in range(2):
A = A + 4
for k in range(2):
A = A + 3
for k in range(1):
A = A + 2
A = A + 8
for k in range(2):
A = A + 7
for k in range(8):
A = A + 6
A = A + 1
A = A + 7
for j in range(8):
A = A + 2
for j in range(8):
for k in range(6):
A = A + 1
A = A + 6
for k in range(2):
A = A + 4
A = A + 1
A = A + 7
A = A + 4
for i in range(4):
for j in range(9):
A = A + 2
for j in range(1):
A = A + 2
A = A + 5
for i in range(8):
for j in range(6):
A = A + 3
for j in range(4):
A = A + 1
A = A + 6
A = A + 1
for j in range(7):
A = A + 7
for k in range(7):
A = A + 3
A = A + 9
A = A + 1
A = A + 9
for k in range(3):
A = A + 5
A = A + 5
A = A + 6
A = A + 2
for j in range(1):
A = A + 4
for j in range(2):
A = A + 7
for j in range(1):
A = A + 7
for k in range(4):
A = A + 7
A = A + 2
for k in range(5):
A = A + 9
A = A + 1
A = A + 9
A = A + 5
A = A + 9
for k in range(5):
A = A + 5
for k in range(1):
A = A + 6
for k in range(2):
A = A + 3
A = A + 2
A = A + 6
A = A + 8
A = A + 8
A = A + 7
A = A + 5
A = A + 5
for i in range(2):
A = A + 1
A = A + 7
A = A + 3
for i in range(2):
A = A + 7
A = A + 1
A = A + 4
for i in range(1):
for j in range(7):
for k in range(2):
A = A + 3
A = A + 5
A = A + 2
A = A + 6
A = A + 1
A = A + 2
A = A + 4
A = A + 9
for i in range(1):
A = A + 8
for i in range(8):
for j in range(4):
for k in range(8):
A = A + 4
for k in range(3):
A = A + 1
A = A + 8
for k in range(7):
A = A + 8
for k in range(7):
A = A + 7
A = A + 7
for k in range(7):
A = A + 6
for k in range(5):
A = A + 9
A = A + 3
for k in range(4):
A = A + 5
A = A + 5
A = A + 4
for j in range(9):
for k in range(3):
A = A + 4
A = A + 3
A = A + 6
for k in range(1):
A = A + 3
A = A + 3
A = A + 6
for k in range(6):
A = A + 7
A = A + 7
A = A + 5
A = A + 5
A = A + 1
A = A + 2
A = A + 6
A = A + 6
for j in range(9):
A = A + 6
for j in range(1):
for k in range(2):
A = A + 4
A = A + 7
for k in range(3):
A = A + 6
for k in range(5):
A = A + 3
A = A + 6
for k in range(9):
A = A + 3
A = A + 6
for j in range(5):
A = A + 8
A = A + 8
for k in range(3):
A = A + 7
A = A + 9
A = A + 8
A = A + 3
A = A + 3
A = A + 9
for i in range(6):
A = A + 9
A = A + 1
for i in range(4):
for j in range(1):
A = A + 7
for j in range(9):
A = A + 2
A = A + 9
A = A + 1
A = A + 2
A = A + 8
A = A + 7
A = A + 9
A = A + 6
for i in range(4):
for j in range(2):
A = A + 3
for j in range(3):
A = A + 4
A = A + 4
for i in range(6):
A = A + 6
A = A + 1
A = A + 5
A = A + 8
for i in range(2):
A = A + 6
for j in range(1):
for k in range(2):
A = A + 2
for k in range(3):
A = A + 1
for k in range(1):
A = A + 8
A = A + 7
A = A + 4
A = A + 2
A = A + 8
A = A + 4
for j in range(5):
for k in range(6):
A = A + 8
for k in range(9):
A = A + 5
A = A + 5
for j in range(5):
A = A + 5
for j in range(3):
for k in range(5):
A = A + 4
for k in range(4):
A = A + 6
A = A + 3
for k in range(7):
A = A + 3
A = A + 3
A = A + 1
A = A + 7
A = A + 7
A = A + 6
A = A + 5
A = A + 5
A = A + 6
for j in range(1):
A = A + 9
A = A + 3
for j in range(1):
for k in range(1):
A = A + 1
for k in range(8):
A = A + 5
for k in range(8):
A = A + 6
for k in range(4):
A = A + 9
A = A + 4
for j in range(2):
A = A + 3
A = A + 7
for k in range(5):
A = A + 7
A = A + 5
A = A + 8
A = A + 7
A = A + 8
A = A + 5
for j in range(2):
A = A + 5
A = A + 7
A = A + 8
A = A + 5
A = A + 9
for i in range(2):
for j in range(6):
A = A + 9
A = A + 1
A = A + 8
A = A + 7
A = A + 1
A = A + 5
for j in range(3):
A = A + 3
A = A + 9
A = A + 7
for j in range(3):
A = A + 9
A = A + 1
for j in range(6):
A = A + 1
for j in range(9):
for k in range(7):
A = A + 3
for k in range(5):
A = A + 5
A = A + 8
A = A + 8
A = A + 1
A = A + 2
for k in range(4):
A = A + 6
for k in range(3):
A = A + 3
A = A + 7
for j in range(8):
for k in range(1):
A = A + 7
A = A + 8
A = A + 3
A = A + 1
A = A + 2
A = A + 4
A = A + 7
for i in range(1):
for j in range(1):
for k in range(1):
A = A + 4
A = A + 6
for k in range(1):
A = A + 3
A = A + 9
A = A + 6
for k in range(9):
A = A + 1
A = A + 6
for k in range(5):
A = A + 3
A = A + 9
A = A + 5
A = A + 5
A = A + 7
A = A + 2
for j in range(2):
A = A + 7
A = A + 7
for j in range(7):
for k in range(4):
A = A + 6
A = A + 8
for k in range(6):
A = A + 6
for k in range(2):
A = A + 1
A = A + 7
A = A + 6
A = A + 7
for j in range(4):
for k in range(7):
A = A + 1
for k in range(2):
A = A + 2
A = A + 5
A = A + 8
A = A + 2
A = A + 1
A = A + 4
for i in range(8):
A = A + 5
A = A + 6
for i in range(7):
for j in range(6):
for k in range(9):
A = A + 7
A = A + 8
for k in range(4):
A = A + 6
A = A + 4
A = A + 3
A = A + 6
for k in range(9):
A = A + 3
for k in range(9):
A = A + 2
A = A + 7
A = A + 5
A = A + 2
for i in range(7):
for j in range(8):
for k in range(6):
A = A + 4
A = A + 9
A = A + 5
A = A + 3
A = A + 9
for j in range(4):
for k in range(1):
A = A + 6
A = A + 8
for k in range(1):
A = A + 6
A = A + 4
A = A + 6
for j in range(3):
A = A + 7
for k in range(3):
A = A + 4
A = A + 4
A = A + 2
A = A + 3
A = A + 7
for j in range(5):
A = A + 6
A = A + 5
for j in range(1):
for k in range(8):
A = A + 5
for k in range(3):
A = A + 6
for k in range(9):
A = A + 4
A = A + 3
for j in range(6):
for k in range(2):
A = A + 1
A = A + 5
A = A + 2
A = A + 2
A = A + 7
for i in range(4):
A = A + 7
A = A + 9
A = A + 2
for i in range(8):
A = A + 9
for j in range(9):
for k in range(2):
A = A + 3
A = A + 2
A = A + 1
A = A + 5
for k in range(9):
A = A + 1
A = A + 3
A = A + 9
for k in range(7):
A = A + 2
for k in range(5):
A = A + 9
A = A + 3
for k in range(2):
A = A + 4
for k in range(8):
A = A + 9
for k in range(5):
A = A + 5
A = A + 4
A = A + 2
A = A + 4
for j in range(6):
A = A + 2
for k in range(5):
A = A + 7
A = A + 7
A = A + 8
A = A + 3
for k in range(8):
A = A + 2
A = A + 5
for k in range(1):
A = A + 8
A = A + 5
A = A + 1
A = A + 1
A = A + 5
for k in range(2):
A = A + 6
for k in range(6):
A = A + 9
A = A + 2
A = A + 5
for k in range(4):
A = A + 7
A = A + 1
for k in range(6):
A = A + 8
A = A + 4
for j in range(3):
for k in range(2):
A = A + 1
A = A + 5
for k in range(2):
A = A + 7
for k in range(9):
A = A + 6
A = A + 8
A = A + 9
A = A + 5
for j in range(9):
for k in range(3):
A = A + 7
A = A + 7
A = A + 9
A = A + 7
for k in range(5):
A = A + 7
A = A + 2
A = A + 1
A = A + 8
A = A + 3
A = A + 5
A = A + 1
for i in range(8):
A = A + 4
A = A + 2
A = A + 2
A = A + 8
for i in range(4):
for j in range(4):
A = A + 8
for k in range(7):
A = A + 5
A = A + 2
for k in range(2):
A = A + 6
for k in range(4):
A = A + 8
A = A + 6
A = A + 1
A = A + 3
A = A + 2
A = A + 7
A = A + 4
for i in range(8):
A = A + 2
A = A + 4
for i in range(5):
for j in range(3):
for k in range(6):
A = A + 8
A = A + 1
A = A + 6
A = A + 5
A = A + 9
for i in range(8):
A = A + 7
for i in range(6):
A = A + 4
A = A + 5
for i in range(3):
A = A + 1
for j in range(1):
for k in range(5):
A = A + 6
A = A + 2
for j in range(9):
for k in range(5):
A = A + 9
A = A + 3
for k in range(9):
A = A + 9
A = A + 8
for j in range(8):
for k in range(5):
A = A + 9
A = A + 4
for k in range(9):
A = A + 3
A = A + 4
A = A + 5
for i in range(9):
for j in range(7):
A = A + 5
for j in range(3):
A = A + 7
for j in range(9):
for k in range(6):
A = A + 4
A = A + 6
for j in range(5):
for k in range(6):
A = A + 5
A = A + 3
A = A + 3
A = A + 3
A = A + 5
for j in range(7):
A = A + 5
for k in range(2):
A = A + 5
A = A + 6
for k in range(2):
A = A + 2
A = A + 5
A = A + 3
A = A + 5
A = A + 5
for i in range(4):
A = A + 2
A = A + 1
for j in range(9):
A = A + 9
A = A + 5
A = A + 6
A = A + 2
A = A + 2
A = A + 5
for j in range(9):
A = A + 5
A = A + 4
for j in range(4):
for k in range(4):
A = A + 1
A = A + 2
for k in range(6):
A = A + 9
A = A + 3
for k in range(2):
A = A + 5
A = A + 1
A = A + 1
A = A + 3
A = A + 8
for k in range(7):
A = A + 4
for k in range(6):
A = A + 9
for k in range(5):
A = A + 9
A = A + 8
A = A + 3
A = A + 9
A = A + 4
A = A + 6
for i in range(7):
A = A + 9
for i in range(9):
A = A + 4
A = A + 9
A = A + 1
A = A + 3
for j in range(5):
for k in range(1):
A = A + 4
A = A + 4
for k in range(8):
A = A + 9
A = A + 6
A = A + 2
for k in range(3):
A = A + 4
A = A + 4
for k in range(3):
A = A + 5
A = A + 2
A = A + 8
A = A + 3
A = A + 6
A = A + 4
A = A + 9
A = A + 1
A = A + 9
A = A + 5
A = A + 3
for k in range(3):
A = A + 2
A = A + 5
A = A + 8
A = A + 2
A = A + 5
for j in range(8):
for k in range(2):
A = A + 6
A = A + 7
A = A + 6
A = A + 9
A = A + 2
for i in range(2):
A = A + 3
for j in range(8):
A = A + 7
A = A + 2
A = A + 1
A = A + 4
A = A + 1
A = A + 5
A = A + 2
A = A + 1
for j in range(1):
A = A + 1
for j in range(6):
A = A + 4
A = A + 3
A = A + 3
for j in range(5):
A = A + 3
for j in range(6):
for k in range(1):
A = A + 5
A = A + 7
A = A + 7
A = A + 7
for k in range(5):
A = A + 9
A = A + 7
for k in range(5):
A = A + 9
A = A + 1
A = A + 9
A = A + 8
for k in range(1):
A = A + 2
for k in range(5):
A = A + 8
for k in range(3):
A = A + 2
A = A + 9
A = A + 6
A = A + 3
for j in range(5):
for k in range(6):
A = A + 5
A = A + 5
for k in range(4):
A = A + 5
A = A + 4
for k in range(8):
A = A + 9
A = A + 1
for k in range(8):
A = A + 8
A = A + 1
A = A + 4
for k in range(6):
A = A + 6
for k in range(2):
A = A + 3
A = A + 9
A = A + 6
A = A + 9
for k in range(1):
A = A + 4
for k in range(3):
A = A + 3
A = A + 4
A = A + 2
A = A + 8
for k in range(2):
A = A + 4
A = A + 1
for k in range(9):
A = A + 2
A = A + 9
A = A + 7
for i in range(7):
for j in range(7):
for k in range(5):
A = A + 7
for k in range(5):
A = A + 1
A = A + 1
for j in range(5):
A = A + 6
for k in range(1):
A = A + 4
for k in range(9):
A = A + 4
A = A + 1
for j in range(6):
A = A + 8
A = A + 5
for k in range(1):
A = A + 4
for k in range(5):
A = A + 8
A = A + 7
A = A + 2
for j in range(3):
A = A + 3
for j in range(8):
for k in range(8):
A = A + 4
A = A + 7
for k in range(5):
A = A + 1
for k in range(8):
A = A + 7
A = A + 8
A = A + 4
A = A + 7
A = A + 6
A = A + 9
A = A + 5
for i in range(3):
A = A + 5
for j in range(9):
A = A + 1
A = A + 7
for i in range(1):
A = A + 8
A = A + 4
for i in range(8):
for j in range(7):
A = A + 2
for k in range(4):
A = A + 6
A = A + 6
for j in range(1):
A = A + 7
A = A + 1
for i in range(9):
for j in range(5):
A = A + 6
A = A + 5
for k in range(7):
A = A + 3
A = A + 6
A = A + 8
for j in range(2):
A = A + 7
A = A + 1
A = A + 9
for j in range(3):
for k in range(3):
A = A + 5
print(A)
``````