kalitarix

Snowballs

Dec 6th, 2018
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.54 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text.RegularExpressions;
  5. using System.Numerics;
  6.  
  7. namespace MOBA_Challenger
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Snowball bestBall = new Snowball();
  14.             bestBall.snowballSnow = 0;
  15.             bestBall.snowballTime = 0;
  16.             bestBall.snowballQuality = 0;
  17.             bestBall.snowballValue = 0;
  18.  
  19.             int snowballsCount = int.Parse(Console.ReadLine());
  20.  
  21.             for (int i = 0; i < snowballsCount; i++)
  22.             {
  23.                 Snowball snowball = new Snowball();
  24.                 snowball.snowballSnow = int.Parse(Console.ReadLine());
  25.                 snowball.snowballTime = int.Parse(Console.ReadLine());
  26.                 snowball.snowballQuality = int.Parse(Console.ReadLine());
  27.  
  28.                 snowball.snowballValue = BigInteger.Pow(snowball.snowballSnow / snowball.snowballTime, snowball.snowballQuality);
  29.  
  30.                 if (snowball.snowballValue > bestBall.snowballValue)
  31.                 {
  32.                     bestBall = snowball;
  33.                 }
  34.             }
  35.  
  36.             Console.WriteLine($"{bestBall.snowballSnow} : {bestBall.snowballTime} = {bestBall.snowballValue} ({bestBall.snowballQuality})");
  37.         }
  38.        
  39.     }
  40.  
  41.     class Snowball
  42.     {
  43.         public int snowballSnow { get; set; }
  44.         public int snowballTime { get; set; }
  45.         public int snowballQuality { get; set; }
  46.         public BigInteger snowballValue { get; set; }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment