Проблем със задача в judge.Clever Lily
using System;
namespace MyFirstProject2
{
class Program
{
static void Main(string[] args)
{
int age = int.Parse(Console.ReadLine());
double WPrice = double.Parse(Console.ReadLine());
double PriceToys = double.Parse(Console.ReadLine());
double savedMoney = 0;
double moneyPresent = 0;
int toyCounter = 0;
for (int i = 0; i <=age ; i++)
{
if(i %2 ==0)
{
savedMoney += moneyPresent;
moneyPresent += 10;
savedMoney--;
}
else
{
toyCounter++;
}
}
double savedMoneyToys = toyCounter * PriceToys;
savedMoney += savedMoneyToys;
if(savedMoney >=WPrice)
{
Console.WriteLine($"Yes! {savedMoney-WPrice:f2}");
}
else
{
Console.WriteLine($"No! {WPrice-savedMoney:f2}");
}
}
}
}