import math


def tile2deg(zoom: int, x: int, y: int) -> tuple[float, float]:
    """Get top-left coordinate of a tile."""
    lat_rad = math.pi - 2 * math.pi * y / (2 ** zoom)
    lat_rad = 2 * math.atan(math.exp(lat_rad)) - math.pi / 2
    lat = lat_rad * 180 / math.pi
    # Handling latitude out of range is not necessary
    # longitude maps linearly to map, so we simply scale:
    lng = -180 + (360 * x / (2 ** zoom) % 360)
    return (lat, lng)