Created
November 14, 2016 12:42
-
-
Save Vitosh/01e3ce215de5ecb70b42cafc2dd2b8d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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