def count_total(P, x, y):
    """
    This function calculates suffix sums, which are the totals of the k last values.
    Args:
    P: an array contains the consecutive sums of the first n elements
    x: an integer, whih is number of elements of a prefix-sum array
    y: an integer, whih is number of elements of a prefix-sum array
    
    Returns: 
    an array suffix sums, which are the totals of the k last values
    or the totals of m slices [x..y] such that 0 <= x <= y < n

    """
    return P[y + 1] - P[x]