def calculate_ap_from_pr(precisions: list, recalls: list) -> float:
    """Calculate Average Percision from P-R pairs"""
    AP = 0
    for i in range(len(precisions) - 1):
        AP += (recalls[i] - recalls[i+1]) * (precisions[i] + precisions[i+1]) / 2
    return AP