Skip to content

Instantly share code, notes, and snippets.

@Vitosh
Created November 14, 2016 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vitosh/01e3ce215de5ecb70b42cafc2dd2b8d0 to your computer and use it in GitHub Desktop.
Save Vitosh/01e3ce215de5ecb70b42cafc2dd2b8d0 to your computer and use it in GitHub Desktop.
using System;
class t01
{
static void Main()
{
string str_read = "";
long long_total = long.Parse(Console.ReadLine());
long long_left;
long long_right;
long long_answer = 0;
long long_display = -1;
for (long i = 1; i <= long_total; i++)
{
str_read = Console.ReadLine();
long_left = long.Parse(str_read.Split()[0]);
long_right = long.Parse(str_read.Split()[1]);
if ((Math.Abs(long_left - long_right) > long_answer)&&(long_left>long_right))
{
long_answer = Math.Abs (long_left- long_right);
long_display = i;
}
}
if (long_display == -1)
{
Console.WriteLine(0);
}
else
{
Console.WriteLine(long_display);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment