#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #1152
Task: , given the user's query and the provided information, the assistant's response is correct. The response starts with "Write a Python function that" and suggests a task that is testable by running it. 
Generated: 2026-02-12T22:10:22.387964
"""

def calculate_average_emotional_peak_over_memory_recall(messages):
    total_emotional_peak = 0
    total_memory_recall = 0

    for message in messages:
        parts = message.split(" - ")
        if len(parts) < 2:
            continue
        emotional_peak = int(parts[0])
        memory_recall = int(parts[1])
        total_emotional_peak += emotional_peak
        total_memory_recall += memory_recall

    if total_memory_recall == 0:
        return 0
    return total_emotional_peak / total_memory_recall


if __name__ == '__main__':
    test_messages = [
        "5 - 2",
        "7 - 3",
        "4 - 1",
        "9 - 4"
    ]
    result = calculate_average_emotional_peak_over_memory_recall(test_messages)
    print(result)