Advertisement
nikolapetkov824

Snowballs

Oct 2nd, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace snowballs
  5. {
  6. class Program
  7. {
  8. static void Main()
  9. {
  10. int n = int.Parse(Console.ReadLine());
  11. BigInteger maxNumber = int.MinValue;
  12. int snowCopy = 0;
  13. int timeCopy = 0;
  14. int qualityCopy = 0;
  15. for (int i = 1; i <= n; i++)
  16. {
  17. int snow = int.Parse(Console.ReadLine());
  18. int time = int.Parse(Console.ReadLine());
  19. int quality = int.Parse(Console.ReadLine());
  20.  
  21. BigInteger value = BigInteger.Pow((snow / time), quality);
  22. if (value>maxNumber)
  23. {
  24. maxNumber = value;
  25. snowCopy = snow;
  26. timeCopy = time;
  27. qualityCopy = quality;
  28. }
  29. }
  30. Console.WriteLine($"{snowCopy} : {timeCopy} = {maxNumber} ({qualityCopy})");
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement