deleriumbg

Untitled

May 26th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Dragons_Hatching
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int teams = int.Parse(Console.ReadLine());
  10. double dragonsHatchingValue = double.Parse(Console.ReadLine());
  11. double sum = 0;
  12.  
  13. for (int i = 0; i < teams; i++)
  14. {
  15. string[] input = Console.ReadLine().Split(' ');
  16. long dragonsHatched = long.Parse(input[0]);
  17. long teamMembersCount = long.Parse(input[1]);
  18. double teamPoints = (double)dragonsHatched / teamMembersCount;
  19. sum += teamPoints;
  20. }
  21. double result = sum / dragonsHatchingValue;
  22. Console.WriteLine($"{result:f3}");
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment