# Problem Description
This appears to be a logistics/transportation problem involving a truck traveling past multiple barns. The truck's speed changes based on its weight, which is modified at each barn it passes. We need to calculate the truck's speed at a specific time point given its initial conditions and weight changes at each barn.

# Visual Facts
1. The image shows a linear path with multiple barns (Barn 1, Barn 2, Barn 3, etc.)
2. Each barn is associated with a weight change (b₁, b₂, b₃, etc.)
3. Time is marked at discrete intervals (t = 0, 1, 2, 3, ..., i)
4. Initial conditions are:
   - At t = 0: Weight = W₀, Velocity = V₀
5. There are two sets of equations at each time step:
   - Weight equation: Wᵢ = Wᵢ₋₁ - bᵢ
   - Velocity equation: Vᵢ = V₀ * W₀/Wᵢ

# Visual Patterns
1. Weight Pattern:
   - Weight changes are sequential: Each new weight is previous weight minus the barn's weight change
   - W₁ = W₀ - b₁
   - W₂ = W₁ - b₂
   - W₃ = W₂ - b₃

2. Velocity Pattern:
   - Velocity is inversely proportional to current weight
   - The formula V₀ * W₀/Wᵢ is consistent across all time steps
   - As weight decreases, velocity increases proportionally

3. Time-Space Relationship:
   - Each time unit corresponds to passing one barn
   - The process continues in a linear fashion
   - At time t, the truck has passed t barns and experienced t weight changes

4. Conservation Rule:
   - The initial weight (W₀) and initial velocity (V₀) are used as reference points for all future calculations
   - The ratio W₀/Wᵢ is the key factor in determining velocity changes


# Solution
def solution(v_0: int, w_0: int, t: int, barns: list[int]) -> int:
    """
    Calculates the value of v at time t based on the given pattern.

    Parameters:
        v_0 (int): Initial value of v
        w_0 (int): Initial value of w
        t (int): Target time at which to calculate v
        barns (list[int]): Points in time where changes occur

    Returns:
        int: Value of v at time t (v_t)
    """
    left_weight = w_0
    velocity = v_0
    for i in range(1,t+1):
        weight = barns[i-1]
        left_weight -= weight
        velocity = int(v_0 * w_0 / left_weight)
    return velocity


# Test Script
def test():
    test_cases = [
        (10, 15, 0, [3,2,1,6], 10),
        (10, 15, 1, [3,2,1,6], 12),
        (10, 15, 2, [3,2,1,6], 15),
        (10, 15, 3, [3,2,1,6], 16),
        (10, 15, 4, [3,2,1,6], 50),
        (10, 15, 5, [3,2,1,6, 2], 150),
        (15, 25, 0, [4,5,3], 15),
        (15, 25, 1, [4,5,3], 17),
        (15, 25, 2, [4,5,3], 23),
        (15, 25, 3, [4,5,3], 28),
    ]
    for v_0, w_0, t, barns, expected_output in test_cases:
        try:
            output = solution(v_0, w_0, t, barns)
        except Exception as e:
            error_message = (
                f"An exception occurred while running the test case:\n"
                f"`v_0`: {v_0}\n"
                f"`w_0`: {w_0}\n"
                f"`t`: {t}\n"
                f"`barns`: {barns}\n\n"
                f"Exception: '{str(e)}'"
            )
            assert False, error_message
            
        if output != expected_output:
            error_message = (
                f"The following Test Case failed:\n"
                f"`v_0`: {v_0}\n"
                f"`w_0`: {w_0}\n"
                f"`t`: {t}\n"
                f"`barns`: {barns}\n\n"
                f"Actual Output: {output}\n"
                f"Expected Output: {expected_output}"
            )
            assert False, error_message

test()