def parse_cpp_output(output: str) -> dict:
    """
    Parse the terminal output of cpp tests into a dictionary

    Args:
        output (str): Raw terminal output from the executable

    Returns:
        dict: Organized results from the executable
    """
    lines = output.split("\n")
    raw_stats = lines[-3:-1]

    queries = raw_stats[0].split(" ")[4]
    time = raw_stats[0].split(" ")[6]
    queries_per_sec = raw_stats[1].split(" ")[4]

    stats = {
        "queries": int(queries),
        "time": float(time) / 1000,  # convert to seconds
        "qps": float(queries_per_sec),
    }

    return stats