#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #1173
Task: \boxed{}</think>

Write a Python function that calculates the number of years remaining until retirement based on current age, current savings, annual savings rate, and target retirement amount.
Generated: 2026-02-12T22:59:27.395148
"""

import math

def years_until_retirement(current_age, current_savings, annual_savings_rate, target_retirement_amount):
    annual_savings = annual_savings_rate
    years = 0
    while current_savings < target_retirement_amount:
        current_savings += annual_savings
        years += 1
    return years

if __name__ == '__main__':
    current_age = 30
    current_savings = 50000
    annual_savings_rate = 15000
    target_retirement_amount = 500000

    years = years_until_retirement(current_age, current_savings, annual_savings_rate, target_retirement_amount)
    print(f"Years until retirement: {years}")