# Problem Description
This is a target shooting scoring problem where shots are made on a 10x10 grid. Each shot's position (x,y) needs to be evaluated against three concentric scoring regions, and the total score needs to be calculated. Each region has a different point value, with higher points awarded for shots closer to the center.

# Visual Facts
1. The grid is 10x10, with coordinates ranging from 1 to 10 on both axes
2. There are three distinct scoring regions:
   - Blue (outermost): Covers the entire 10x10 grid
   - Pink (middle): Smaller rectangular region
   - Green (innermost): Smallest rectangular region in the center
3. Scoring values:
   - Blue region = 1 point
   - Pink region = 5 points
   - Green region = 10 points
4. Region coordinates:
   - Green region: (4,7) to (7,4)
   - Pink region: (2,9) to (9,2)
   - Blue region: (1,10) to (10,1)

# Visual Patterns
1. Scoring Logic:
   - Score calculation pattern:
     * Check if shot is in green region first (10 points)
     * If not, check pink region (5 points)
     * If not, award 1 point (blue region)

2. Region Validation Pattern:
   - A shot (x,y) is in a region if:
     * x is between region's left and right boundaries
     * y is between region's bottom and top boundaries


# Solution
from typing import List, Tuple

def solution(shots: List[Tuple[int, int]]) -> int:
    """
    Calculate the total score based on the shot locations and the areas, with points assigned according to the different colored areas on the grid.

    Args:
    shots: A list of tuples where each tuple contains the x and y coordinates of a shot.

    Returns:
    int: The total score calculated based on the shots in the grid.
    """
    def calculate_score(x: int, y: int) -> int:
        # Central green area (Score 10)
        if 4 <= x <= 7 and 4 <= y <= 7:
            return 10
        # Surrounding orange area (Score 5)
        elif 2 <= x <= 9 and 2 <= y <= 9:
            return 5
        # Surrounding blue area (Score 1)
        elif 1 <= x <= 10 and 1 <= y <= 10:
            return 1
        else:
            return 0

    # Calculate total score by summing the scores for all shots
    total_score = sum(calculate_score(x, y) for x, y in shots)
    
    return total_score


# Test Script
def test():
    test_cases = [
        ([(1, 1), (3, 3)], 6),
        ([(2, 2), (4, 4)], 15),
        ([(5, 5), (6, 6), (4, 4), (7, 7), (3, 3)], 45),
        ([(7, 8), (3, 2), (5, 5), (6, 6)], 30),
        ([], 0),
        ([(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)], 62),
        ([(5, 6), (6, 5), (5, 5), (6, 6)], 40),
        ([(5, 4), (6, 7), (3, 8), (8, 3)], 30),
        ([(5, 5), (6, 6), (4, 4), (7, 7), (3, 3)], 45),
        ([(5, 1), (6, 2), (4, 3), (7, 4), (3, 5)], 26)
    ]
    for shots, expected_output in test_cases:
        try:
            output = solution(shots)
        except Exception as e:
            error_message = (
                f"An exception occurred while running the test case:\n"
                f"`shots`: {shots}\n\n"
                f"Exception: '{str(e)}'"
            )
            assert False, error_message

        if output != expected_output:
            error_message = (
                f"The following Test Case failed:\n"
                f"`shots`: {shots}\n\n"
                f"Actual Output: {output}\n"
                f"Expected Output: {expected_output}"
            )
            assert False, error_message

test()