from typing import Tuple
from typing import List


def calculate_ro_factor(jobs_chain: Tuple[List[int], List[int]]) -> Tuple[float, int]:
    """
    This method calculates the ro-factor of a given job chain composed
    by the weights and execution times.

    The ro-ratio is calculated saving the max of the cumulative sum of
    the weights divided by the cumulative sum of the execution time.

    :param jobs_chain: set of jobs with the weight and execution time
    :return: value of the ro-factor and the index of the job that generates it
    """
    ro_factor = 0
    job = 0
    cum_weight = 0
    cum_time = 0
    for i in range(len(jobs_chain[1])):
        cum_weight += jobs_chain[0][i]
        cum_time += jobs_chain[1][i]
        ratio = cum_weight / cum_time
        if ratio > ro_factor:
            ro_factor = ratio
            job = i
    return ro_factor, job