import sumInRange


def test_case1():
    assert sumInRange.sumInRange([3, 0, -2, 6, -3, 2], [[0, 2], [2, 5], [0, 5]]) == 10


def test_case2():
    assert sumInRange.sumInRange([-1000], [[0, 0]]) == 999999007


def test_case3():
    assert sumInRange.sumInRange([34, 19, 21, 5, 1, 10, 26, 46, 33, 10],
                                 [[3, 7], [3, 4], [3, 7], [4, 5], [0, 5]]) == 283


def test_case4():
    assert sumInRange.sumInRange([-4, -18, -22, -14, -33, -47, -29, -35, -50, -19],
                                 [[2, 9], [5, 6], [1, 2], [2, 2], [4, 5]]) == 999999540


def test_case5():
    assert sumInRange.sumInRange(
        [-23, -8, -52, -58, 93, -16, -26, 75, -77, 25, 90, -50, -31, 70, 53, -68, 96, 100, 69, 13],
        [[0, 4], [0, 8], [7, 7], [3, 4], [2, 3], [0, 3], [8, 8], [2, 2], [5, 7], [2, 2]]) == 999999578


def test_case6():
    assert sumInRange.sumInRange(
        [-77, 54, -59, -94, -13, -78, -81, -38, -26, 17, -73, -88, 90, -42, -63, -36, 37, 25, -22, 4, 25, -86, -44, 88,
         2, -47, -29, 71, 54, -42], [[2, 2], [4, 7], [2, 4], [0, 2], [3, 6], [6, 6], [3, 3], [2, 7], [3, 4], [3, 3],
        [2, 9], [0, 1], [4, 4], [2, 3], [0, 6], [4, 4], [2, 3], [0, 5], [2, 5], [4, 5]]) == 999996808


def test_case7():
    assert sumInRange.sumInRange([1000], [[0, 0]]) == 1000
