промежутое

This commit is contained in:
2025-12-05 11:48:13 +05:00
parent 30647281a5
commit dcb80ef973
48 changed files with 1190 additions and 0 deletions

28
programm8.py Normal file
View File

@@ -0,0 +1,28 @@
f = open('INPUT.TXT')
line = f.readline().strip().split()
f.close()
start = line[0]
end = line[1]
start_col = ord(start[0]) - ord('a')
start_row = int(start[1]) - 1
end_col = ord(end[0]) - ord('a')
end_row = int(end[1]) - 1
can_reach = False
if end_row > start_row:
diff_row = end_row - start_row
diff_col = abs(end_col - start_col)
if diff_row == diff_col:
can_reach = True
f = open('OUTPUT.TXT', 'w')
if can_reach:
f.write('YES')
else:
f.write('NO')
f.close()