distance = float(input())
duration = int(input())
cost_per_km = float(input())
total_cost = 2 * distance * cost_per_km
if distance > 1000 and duration > 7:
total_cost *= 0.7
print(total_cost)
distance = float(input())
duration = int(input())
cost = distance * 2
if distance > 1000 and duration > 7:
cost *= 0.7
print(cost)
На питоне пожалуйста!!!