-
Notifications
You must be signed in to change notification settings - Fork 5
/
Start.cs
26 lines (23 loc) · 890 Bytes
/
Start.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
namespace CharityMarathon
{
using System;
using System.Collections.Generic;
using System.Linq;
public class Start
{
public static void Main()
{
long days = long.Parse(Console.ReadLine());
long runnersCount = long.Parse(Console.ReadLine());
int lapsPerRunner = int.Parse(Console.ReadLine());
long trackLenght = long.Parse(Console.ReadLine());
long trackCapacity = long.Parse(Console.ReadLine());
decimal moneyPerKm = decimal.Parse(Console.ReadLine());
long maxRunners = trackCapacity * days;
long willRun = Math.Min(maxRunners,runnersCount);
long totalKm = (willRun * lapsPerRunner * trackLenght)/1000;
decimal risedMoney = moneyPerKm * totalKm;
Console.WriteLine($"Money raised: {risedMoney:f2}");
}
}
}