Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _01.Trainers
- {
- class Program
- {
- static void Main(string[] args)
- {
- Dictionary<string, double> teams = new Dictionary<string, double> {
- { "Technical",0},
- { "Theoretical",0},
- { "Practical",0}
- };
- int n = int.Parse(Console.ReadLine());
- for (int i = 0; i < n; i++)
- {
- long distance = long.Parse(Console.ReadLine());
- double cargo = double.Parse(Console.ReadLine());
- string team = Console.ReadLine().Trim();
- cargo *= 1000;
- distance *= 1600;
- double earned = (cargo * 1.5) - (0.7*distance*2.5);
- teams[team] += earned;
- }
- var winner = teams.OrderByDescending(t => t.Value).First();
- Console.WriteLine("The {0} Trainers win with ${1:F3}.",winner.Key,winner.Value);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement