Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2016
143
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.Text;
  3.  
  4.  
  5. namespace DetectiveBoev
  6. {
  7. class DetectiveBoev
  8. {
  9. static void Main(string[] args)
  10. {
  11. int n = int.Parse(Console.ReadLine());
  12.  
  13. long test = 2 * n - n;
  14.  
  15. long finish = 0;
  16. for (int i = 0; i < test; i++)
  17. {
  18.  
  19. long loops = long.Parse(Console.ReadLine());
  20.  
  21. finish += loops;
  22.  
  23. }
  24.  
  25. long finish2 = 0;
  26.  
  27. for (int i = 0; i < test; i++)
  28. {
  29. long loops = long.Parse(Console.ReadLine());
  30. finish2 += loops;
  31. }
  32.  
  33.  
  34. if (finish >= finish2 && finish <= finish2)
  35. {
  36. Console.WriteLine("Yes, sum={0}",finish,finish2);
  37. }
  38. else if (finish > finish2)
  39. {
  40. Console.WriteLine("No, diff={0}",finish - finish2);
  41. }
  42.  
  43.  
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement