import math


def get_avg_concurrency(tasks):
  """ Returns the maximum number of tasks that were running concurrently. """
  total_task_time = sum([t.runtime() for t in tasks])
  total_time = max([t.finish_time for t in tasks]) - min([t.start_time for t in tasks])
  return math.ceil(float(total_task_time) / total_time)