Advertisement
Guest User

Untitled

a guest
Sep 28th, 2020
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.36 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace Snowballs
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             int snowBallCount = int.Parse(Console.ReadLine());
  11.             BigInteger snowBallValue = new BigInteger(0);
  12.             BigInteger higestSnValue = new BigInteger(0);
  13.             int bestSnSnow = 0;
  14.             int bestSnTime = 0;
  15.             int bestSnQual = 0;
  16.  
  17.             for (int i = snowBallCount - 1; i >= 0; i--)
  18.             {
  19.  
  20.                     int snowballSnow = int.Parse(Console.ReadLine());
  21.                     int snowballTime = int.Parse(Console.ReadLine());
  22.                     int snowballQuality = int.Parse(Console.ReadLine());
  23.  
  24.                    if (snowballTime != 0)
  25.                    {
  26.                         snowBallValue = BigInteger.Pow((snowballSnow / snowballTime), snowballQuality);
  27.  
  28.                         if (snowBallValue > higestSnValue)
  29.                         {
  30.  
  31.                          higestSnValue = snowBallValue;
  32.                          bestSnSnow = snowballSnow;
  33.                          bestSnTime = snowballTime;
  34.                          bestSnQual = snowballQuality;
  35.  
  36.                         }
  37.                    }
  38.  
  39.             }
  40.  
  41.             Console.WriteLine($"{bestSnSnow} : {bestSnTime} = {higestSnValue:F0} ({bestSnQual})");
  42.  
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement