Advertisement
joro_thexfiles

Snowballs - SoftUni

May 27th, 2019
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace _11___Snowballs
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             int n = int.Parse(Console.ReadLine());
  11.             int snowballSnow = 0;
  12.             int snowballTime = 0;
  13.             int snowballQuality = 0;
  14.             BigInteger value = 0;
  15.  
  16.             BigInteger max = 0;
  17.  
  18.             for (int i = 1; i <= n; i++)
  19.             {
  20.                 int snow = int.Parse(Console.ReadLine());
  21.                 int time = int.Parse(Console.ReadLine());
  22.                 int quality = int.Parse(Console.ReadLine());
  23.  
  24.                 value = BigInteger.Pow((snow / time), quality);
  25.  
  26.                 if (value > max)
  27.                 {
  28.                     max = value;
  29.                     snowballSnow = snow;
  30.                     snowballTime = time;
  31.                     snowballQuality = quality;
  32.                 }
  33.  
  34.             }
  35.  
  36.             Console.WriteLine($"{snowballSnow} : {snowballTime} = {max} ({snowballQuality})");
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement