Advertisement
tissiana

FuckingSnowballs

Oct 6th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.59 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Numerics;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Snowballs
  9. {
  10.     class Program
  11.     {
  12.         static void Main()
  13.         {
  14.             int snowballsCounter = int.Parse(Console.ReadLine());
  15.  
  16.             int snowballSnow = int.Parse(Console.ReadLine());
  17.             int snowballTime = int.Parse(Console.ReadLine());
  18.             int snowballQuality = int.Parse(Console.ReadLine());
  19.  
  20.             BigInteger value = snowballSnow / snowballTime;
  21.             BigInteger snowballValue = BigInteger.Pow(value,snowballQuality);
  22.             BigInteger biggestValue = snowballValue;
  23.             int highestSnow = snowballSnow;
  24.             int highestTime = snowballTime;
  25.  
  26.             for (int i = 1; i <= snowballsCounter - 1; i++)
  27.             {
  28.                int newsSnowballSnow = int.Parse(Console.ReadLine());
  29.                int newSnowballTime = int.Parse(Console.ReadLine());
  30.                int newSnowballQuality = int.Parse(Console.ReadLine());
  31.  
  32.                 BigInteger newValue = snowballSnow / snowballTime;
  33.                 BigInteger newSnowballValue = BigInteger.Pow(newValue,newSnowballQuality);
  34.  
  35.                 if(newSnowballValue > snowballValue)
  36.                 {
  37.                     snowballValue = newSnowballValue;
  38.                     highestSnow = newsSnowballSnow;
  39.                     highestTime = newSnowballTime;
  40.                 }
  41.             }
  42.  
  43.             Console.WriteLine($"{highestSnow} : {highestTime} = {biggestValue} ({snowballQuality})");
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement