Advertisement
bullit3189

Snowballs

Jan 23rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. public class Program
  5. {
  6. public static void Main()
  7. {
  8. int snowballs = int.Parse(Console.ReadLine());
  9.  
  10. BigInteger highestValue =0;
  11. int bestSnow =0;
  12. int bestTime =0;
  13. int bestQuality =0;
  14.  
  15. for (int i=1; i<=snowballs; i++)
  16. {
  17. int snowballSnow = int.Parse(Console.ReadLine());
  18. int snowballTime = int.Parse(Console.ReadLine());
  19. int snowballQuality = int.Parse(Console.ReadLine());
  20.  
  21. BigInteger snowballValue = BigInteger.Pow((snowballSnow/snowballTime),snowballQuality);
  22.  
  23. if (snowballValue >highestValue)
  24. {
  25. highestValue = snowballValue;
  26. bestSnow = snowballSnow;
  27. bestTime = snowballTime;
  28. bestQuality = snowballQuality;
  29. }
  30. }
  31. Console.WriteLine("{0} : {1} = {2} ({3})",bestSnow,bestTime,highestValue,bestQuality);
  32.  
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement