Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Numerics;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8.  
  9. namespace _01.Problem
  10. {
  11. class Program
  12. {
  13. static void Main(string[] args)
  14. {
  15. int numberOfSnowballs = int.Parse(Console.ReadLine());
  16.  
  17. List<Tuple<double, double, BigInteger, double>> listOfValues = new List<Tuple<double, double, BigInteger, double>>();
  18.  
  19. for (int i = 0; i < numberOfSnowballs; i++)
  20. {
  21. double snowballSnow = double.Parse(Console.ReadLine());
  22. double snowballTime = double.Parse(Console.ReadLine());
  23. int snowballQuality = int.Parse(Console.ReadLine());
  24.  
  25. BigInteger numberOfThrows = (BigInteger)(snowballSnow / snowballTime);
  26.  
  27. BigInteger snowballValue = BigInteger.Pow(numberOfThrows, snowballQuality);
  28.  
  29. var tuple4Parts = new Tuple<double, double, BigInteger, double>
  30. (snowballSnow, snowballTime, snowballValue, snowballQuality);
  31.  
  32. listOfValues.Add(tuple4Parts);
  33. }
  34.  
  35. var highestSnowBallValue = listOfValues.OrderByDescending(x => x.Item3).First();
  36. Console.WriteLine($"{highestSnowBallValue.Item1} : {highestSnowBallValue.Item2} = {highestSnowBallValue.Item3} ({highestSnowBallValue.Item4})");
  37.  
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement