Buggy python submission (verdict: Runtime Error):
def get_distance_and_next_speed(current_speed, max_speed, time, next_max_speed):
	#CASE 1: /---- or -----(CAN REACH THE MAX SPEED) AND THE NEXT MAX SPEED IS EQUAL TO OR BIGGER THAN CURRENT MAX SPEED
	if max_speed <= next_max_speed and max_speed >= current_speed and max_speed - current_speed <= time:
		#max_speed - current_speed = THE DELTA VELOCITY = THE DELTA TIME < t --> CAN REACH THE MAX SPEED
		acceleration_duration = max_speed - current_speed
		max_speed_duration = time - acceleration_duration
		distance = ((max_speed + current_speed) * acceleration_duration) / 2.0 + max_speed_duration * max_speed
		new_current_speed = max_speed
		return distance, new_current_speed
	
	#CASE 2: /(CAN NOT REACH THE MAX SPEED) AND THE NEXT MAX SPEED IS EQUAL TO OR BIGGER THAN CURRENT MAX SPEED
	elif max_speed <= next_max_speed and max_speed > current_speed and max_speed - current_speed > time:
		#CAN NOT REACH THE MAX SPEED IN THIS DURATION
		max_valid_speed = current_speed + t
		distance = (max_valid_speed + current_speed) * t / 2.0
		new_current_speed = max_valid_speed
		return distance, new_current_speed
	
	#CASE 3: /--\ or --\ THE SUM OF VELOCITY CHANGING DURATION SHALL BE EQUAL TO OR SMALLER THAN TIME
	elif max_speed > next_max_speed and max_speed >= current_speed and (max_speed - current_speed) + (max_speed - next_max_speed) <= time:
		#ACCELERATION PART
		acceleration_duration = max_speed - current_speed
		acceleration_distance = (max_speed + current_speed) * acceleration_duration / 2.0
		
		#MAX SPEED PART				#THE DELTA TIME OF ACCELERATION #THE DELTA TIME OF DECELERATION
		max_speed_duration = time - ((max_speed - current_speed) + (max_speed - next_max_speed))
		max_speed_distance = max_speed_duration * max_speed
		
		#DECELERATION PART
		deceleration_duration = max_speed - next_max_speed
		deceleration_distance = deceleration_duration * (max_speed + next_max_speed) / 2.0
		
		distance = acceleration_distance + max_speed_distance + deceleration_distance
		new_current_speed = next_max_speed
		return distance, new_current_speed
	
	#CASE 4: /\ THAT IS IMPOSSIBLE TO REACH THE MAX VELOCITY
	elif max_speed > next_max_speed and max_speed > current_speed and (max_speed - current_speed) + (max_speed - next_max_speed) > time:
		acceleration_duration = (next_max_speed - current_speed + time) / 2.0
		deceleration_duration = time - acceleration_duration
		max_valid_speed = current_speed + acceleration_duration
		
		#ACCELERATION PART
		acceleration_distance = (max_valid_speed + current_speed) * acceleration_duration / 2.0
		
		#DECELERATION PART
		deceleration_distance = (max_valid_speed + next_max_speed) * deceleration_duration / 2.0
		
		distance = acceleration_distance + deceleration_distance
		new_current_speed = next_max_speed
		return distance, new_current_speed

case_number = input()
time_list = [int(x) for x in raw_input().split()]
velocity_list = [int(x) for x in raw_input().split()]
velocity_list.append(0)	#THE FINAL DECELERATION CAN BE SEEN AS A PART WHOSE MAX VELOCITY IS ZERO
CURRENT_SPEED = 0
TOTAL_DISTANCE = 0
for INDEX in xrange(case_number):
	DELTA_DISTANCE, CURRENT_SPEED = get_distance_and_next_speed(current_speed = CURRENT_SPEED, max_speed = velocity_list[INDEX], time = time_list[INDEX], next_max_speed = velocity_list[INDEX + 1])
	TOTAL_DISTANCE += DELTA_DISTANCE
print TOTAL_DISTANCE

Fixed submission:
def get_distance_and_next_speed(current_speed, max_speed, time, next_max_speed):
	#CASE 1: /---- or -----(CAN REACH THE MAX SPEED) AND THE NEXT MAX SPEED IS EQUAL TO OR BIGGER THAN CURRENT MAX SPEED
	if max_speed <= next_max_speed and max_speed >= current_speed and max_speed - current_speed <= time:
		#max_speed - current_speed = THE DELTA VELOCITY = THE DELTA TIME < t --> CAN REACH THE MAX SPEED
		acceleration_duration = max_speed - current_speed
		max_speed_duration = time - acceleration_duration
		distance = ((max_speed + current_speed) * acceleration_duration) / 2.0 + max_speed_duration * max_speed
		new_current_speed = max_speed
		return distance, new_current_speed, 1
	
	#CASE 2: /(CAN NOT REACH THE MAX SPEED) AND THE NEXT MAX SPEED IS EQUAL TO OR BIGGER THAN CURRENT MAX SPEED
	elif max_speed <= next_max_speed and max_speed > current_speed and max_speed - current_speed > time:
		#CAN NOT REACH THE MAX SPEED IN THIS DURATION
		max_valid_speed = current_speed + time
		distance = (max_valid_speed + current_speed) * time / 2.0
		new_current_speed = max_valid_speed
		return distance, new_current_speed, 2
	
	#CASE 3: /--\ or --\ THE SUM OF VELOCITY CHANGING DURATION SHALL BE EQUAL TO OR SMALLER THAN TIME
	elif max_speed > next_max_speed and max_speed >= current_speed and (max_speed - current_speed) + (max_speed - next_max_speed) <= time:
		#ACCELERATION PART
		acceleration_duration = max_speed - current_speed
		acceleration_distance = (max_speed + current_speed) * acceleration_duration / 2.0
		
		#MAX SPEED PART				#THE DELTA TIME OF ACCELERATION #THE DELTA TIME OF DECELERATION
		max_speed_duration = time - ((max_speed - current_speed) + (max_speed - next_max_speed))
		max_speed_distance = max_speed_duration * max_speed
		
		#DECELERATION PART
		deceleration_duration = max_speed - next_max_speed
		deceleration_distance = deceleration_duration * (max_speed + next_max_speed) / 2.0
		
		distance = acceleration_distance + max_speed_distance + deceleration_distance
		new_current_speed = next_max_speed
		return distance, new_current_speed, 3
	
	#CASE 4: /\ THAT IS IMPOSSIBLE TO REACH THE MAX VELOCITY
	elif max_speed > next_max_speed and max_speed > current_speed and (max_speed - current_speed) + (max_speed - next_max_speed) > time:
		#CASE 1 ONLY / WITH NO DECELERATION
		if current_speed + time <= next_max_speed:
			distance = (current_speed + current_speed + time) * time / 2.0
			new_current_speed = current_speed + time
			return distance, new_current_speed, 4
		
		#CASE 2 /\
		else:
			acceleration_duration = (next_max_speed - current_speed + time) / 2.0
			deceleration_duration = time - acceleration_duration
			max_valid_speed = current_speed + acceleration_duration
			
			#ACCELERATION PART
			acceleration_distance = (max_valid_speed + current_speed) * acceleration_duration / 2.0
			
			#DECELERATION PART
			deceleration_distance = (max_valid_speed + next_max_speed) * deceleration_duration / 2.0
			
			distance = acceleration_distance + deceleration_distance
			new_current_speed = next_max_speed
			return distance, new_current_speed, 4

case_number = input()
time_list = [int(x) for x in raw_input().split()]
velocity_list = [int(x) for x in raw_input().split()]
velocity_list.append(0)	#THE FINAL DECELERATION CAN BE SEEN AS A PART WHOSE MAX VELOCITY IS ZERO
#PREPROCESS TO SIMPLIFY CASES
velocity_list = velocity_list[::-1]
time_list = time_list[::-1]

for vi in xrange(len(velocity_list) - 1):
	cur_v = velocity_list[vi]
	next_v = velocity_list[vi + 1]
	duration_time = time_list[vi]
	next_v = min(next_v, cur_v + duration_time)
	velocity_list[vi + 1] = next_v

velocity_list = velocity_list[::-1]
time_list = time_list[::-1]

CURRENT_SPEED = 0
TOTAL_DISTANCE = 0
DISTANCE_LIST = [0]
SPEED_LIST = [0]

for INDEX in xrange(case_number):
	#print CURRENT_SPEED, velocity_list[INDEX], time_list[INDEX], velocity_list[INDEX + 1]
	DELTA_DISTANCE, CURRENT_SPEED, STATUS = get_distance_and_next_speed(current_speed = CURRENT_SPEED, max_speed = velocity_list[INDEX], time = time_list[INDEX], next_max_speed = velocity_list[INDEX + 1])
	DISTANCE_LIST.append(DELTA_DISTANCE)
	TOTAL_DISTANCE += DELTA_DISTANCE
	SPEED_LIST.append(CURRENT_SPEED)

print '%.10f' % TOTAL_DISTANCE