Cake Tycoon къде ми е грешката
Здравейте, може ли някой да ми каже защо като решавам задачата като я реша така:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CakeTycoon
{
class Program
{
static void Main(string[] args)
{
ulong amount = ulong.Parse(Console.ReadLine());
double kgForOneCake = double.Parse(Console.ReadLine());
uint flaurAvailable = uint.Parse(Console.ReadLine());
uint trufflesAmount = uint.Parse(Console.ReadLine());
uint truffflesPrice = uint.Parse(Console.ReadLine());
double maxCakes = Math.Floor(flaurAvailable / kgForOneCake);
ulong trufflesCost = (ulong)trufflesAmount * truffflesPrice;
if (amount > maxCakes)
{
double flaurNeeded = (amount * kgForOneCake) - flaurAvailable;
Console.WriteLine("Can make only {0} cakes, need {1:f2} kg more flour", maxCakes, flaurNeeded);
}
else
{
double cakePrice = ((double)trufflesCost / amount) * 1.25d;
Console.WriteLine("All products available, price of a cake: {0:f2}", cakePrice);
}
}
}
}
е вярна а като разменя само това в ифа и ми дава 75/100 в джъджа без обяснение
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CakeTycoon
{
class Program
{
static void Main(string[] args)
{
ulong amount = ulong.Parse(Console.ReadLine());
double kgForOneCake = double.Parse(Console.ReadLine());
uint flaurAvailable = uint.Parse(Console.ReadLine());
uint trufflesAmount = uint.Parse(Console.ReadLine());
uint truffflesPrice = uint.Parse(Console.ReadLine());
double maxCakes = Math.Floor(flaurAvailable / kgForOneCake);
ulong trufflesCost = (ulong)trufflesAmount * truffflesPrice;
if (amount < maxCakes)
{
double cakePrice = ((double)trufflesCost / amount) * 1.25d;
Console.WriteLine("All products available, price of a cake: {0:f2}", cakePrice);
}
else
{
double flaurNeeded = (amount * kgForOneCake) - flaurAvailable;
Console.WriteLine("Can make only {0} cakes, need {1:f2} kg more flour", maxCakes, flaurNeeded);
}
}
}
}
ето линк към задачата https://judge.softuni.bg/Contests/Practice/Index/149#0