×

 0 import java.io.*; //import java.io.BufferedOutputStream; //import java.io.BufferedReader; //import java.io.IOException; //import java.io.InputStreamReader; //import java.io.PrintWriter; class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader bu=new BufferedReader(new InputStreamReader(System.in)); PrintWriter pr=new PrintWriter(new BufferedOutputStream(System.out)); int k=Integer.parseInt(bu.readLine()); int a[]=new int[k]; int b[]=new int[k]; int l; for(l=0;l<=k-1;l++) { String n=bu.readLine(); String s[]=n.split(" "); a[l]=Integer.parseInt(s[0]); b[l]=Integer.parseInt(s[1]); } //int sum1=0,sum2=0; int max1=a[0]-b[0],max2=b[0]-a[0]; for(l=0;lb[l]) { if( (a[l]-b[l]) > max1) { max1=a[l]-b[l]; } } if(b[l]>a[l]) { if( (b[l]-a[l]) > max2) { max2=b[l]-a[l]; } } } if(max1 > max2) { pr.print("1 "+ max1); } else if(max2>max1) { pr.print("2 "+ max2); } pr.close(); } }  asked 18 Oct '14, 12:00 0★yash_5 21●2 accept rate: 0% 2.9k●31●53
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×148
×138
×30
×24
×16
×9
×3
×2

question asked: 18 Oct '14, 12:00

question was seen: 549 times

last updated: 18 Oct '14, 12:28