Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace EqualPairs
- {
- class EqualPairs
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int a = int.Parse(Console.ReadLine());
- int b = int.Parse(Console.ReadLine());
- int value = a + b;
- int maxDiff = 0;
- for (int i = 1; i < n; i++)
- {
- a = int.Parse(Console.ReadLine());
- b = int.Parse(Console.ReadLine());
- if (Math.Abs(a + b - value) > maxDiff)
- maxDiff = Math.Abs(a + b - value);
- value = a + b;
- }
- if(maxDiff > 0)
- Console.WriteLine("No, maxdiff=" + maxDiff);
- else
- Console.WriteLine("Yes, value=" + value); }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment