Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.11 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _11Snowballs
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int numberSnowballs = int.Parse(Console.ReadLine());
  10.             double bestValue = double.MinValue;
  11.             int bestSnow = 0;
  12.             int bestTime = 0;
  13.             int bestQuality = 0;
  14.             for (int i = 0; i < numberSnowballs; i++)
  15.             {
  16.                 int snowballSnow = int.Parse(Console.ReadLine());
  17.                 int snowballTime = int.Parse(Console.ReadLine());
  18.                 int snowballQuality = int.Parse(Console.ReadLine());
  19.                 double snowballValue = Math.Pow(((double)snowballSnow / (double)snowballTime), (double)snowballQuality);
  20.                 if (bestValue <= snowballValue)
  21.                 {
  22.                     bestSnow = snowballSnow;
  23.                     bestTime = snowballTime;
  24.                     bestQuality = snowballQuality;
  25.                     bestValue = snowballValue;
  26.                 }
  27.             }
  28.             Console.WriteLine($"{bestSnow} : {bestTime} = {bestValue} ({bestQuality})");
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement