distance_l = (distance_x ** 2 + distance_y ** 2) ** 0.5
speed_x = distance_x / distance_l * SPEED
speed_y = distance_y / distance_l * SPEED
with open('input.txt', 'r') as input_file:
n = int(input_file.read().strip())
out = ''
for i in range(n):
for j in range(n):
if i == 0 or i == n - 1 or j == 0 or j == n - 1 or \
i == j or n - i - 1 == j:
out += '*'
else:
out += ' '
out += '\n'
with open('output.txt', 'w') as output_file:
output_file.write(out.strip())
chkdsk <диск> /f /offlinescanandfix
, никаких ошибок не выдало.