Advertisement
YavorGrancharov

Snowballs (ExamTask01)05.01.18

Jan 5th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace Snowballs
  5. {
  6.     class MainClass
  7.     {
  8.         public static void Main(string[] args)
  9.         {
  10.             BigInteger n = BigInteger.Parse(Console.ReadLine());
  11.  
  12.             BigInteger maxValue = 0;
  13.             BigInteger currentSnow = 0;
  14.             BigInteger currentTime = 0;
  15.             BigInteger currentQuality = 0;
  16.             BigInteger snowballValue = 0;
  17.  
  18.             for (BigInteger i = 0; i < n; i++)
  19.             {
  20.                 BigInteger snowballSnow = BigInteger.Parse(Console.ReadLine());
  21.                 BigInteger snowballTime = BigInteger.Parse(Console.ReadLine());
  22.                 int snowballQuality = int.Parse(Console.ReadLine());
  23.  
  24.                 snowballValue = BigInteger.Pow((snowballSnow / snowballTime), snowballQuality);
  25.  
  26.                 if (maxValue < snowballValue)
  27.                 {
  28.                     maxValue = snowballValue;
  29.                     currentSnow = snowballSnow;
  30.                     currentTime = snowballTime;
  31.                     currentQuality = snowballQuality;
  32.                 }
  33.             }
  34.             Console.WriteLine("{0} : {1} = {2} ({3})",currentSnow, currentTime, maxValue, currentQuality);
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement