from typing import List
from typing import Any
from typing import Tuple
import math
import statistics


def smoothen(xs: List[Any], ys: List[float]) -> Tuple[List[Any], List[float]]:
    """
    Reduce to ~200 data points and apply smoothing.

    :param xs: The list of x-values.
    :param ys: The list of y-values to have the filter applied to.
    :return: The new x and y values.
    """
    n = len(xs)
    window_size = math.ceil(n / 200)
    new_xs, new_ys = [], []
    for window_start in range(0, n, window_size):
        window_end = window_start + window_size
        new_x = xs[window_start]
        new_y = statistics.median(ys[window_start:window_end])
        new_xs.append(new_x)
        new_ys.append(new_y)
    return new_xs, new_ys