Advertisement
j0nze

snowballs

Jan 19th, 2018
1,200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.33 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Numerics;
  7.  
  8. namespace ConsoleApp1
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             int n = int.Parse(Console.ReadLine());
  15.                 PrintSnowballValue(n);      
  16.         }
  17.  
  18.         private static void PrintSnowballValue(int n)
  19.         {
  20.             BigInteger snowballValue = -999999999999;
  21.             int snow = 0;
  22.             int time = 0;
  23.             int quality = 0;
  24.  
  25.             for (int i = 0; i < n; i++)
  26.             {
  27.                 int snowballSnow = int.Parse(Console.ReadLine());
  28.                 int snowballTime = int.Parse(Console.ReadLine());
  29.                 int snowballQuality = int.Parse(Console.ReadLine());
  30.  
  31.                 BigInteger snowballValueCurrent = BigInteger.Pow(snowballSnow / snowballTime, snowballQuality);
  32.  
  33.                 if (snowballValueCurrent > snowballValue)
  34.                 {
  35.                     snowballValue = snowballValueCurrent;
  36.                     snow = snowballSnow;
  37.                     time = snowballTime;
  38.                     quality = snowballQuality;
  39.                 }
  40.             }
  41.             Console.WriteLine($"{snow} : {time} = {snowballValue} ({quality})");          
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement