# Use these as example inputs for A and B
A = [1,3,2,4,5,3,4,2,1]
B = {1:2, 2:1, 3:4, 4:2, 5:3}

# In the first step, use list comprehension to do the first step of the calculation
# Only need to convert one of the values to a float as the other with will implicitly cast to a float
result = [(float(x)/B[x])**2 for x in A]
# In the second step, replace the low values with 0s
result = [0 if x < 1 else x for x in result]

# Pretty print the result array
print(result)

# output:
# [0, 0, 4.0, 4.0, 2.777777777777778, 0, 4.0, 4.0, 0]
