文理学院程序设计在线练习


Throw you out

Time Limit: 1 Second(s)    Memory Limit: 32 MB

Total Submission(s): 19   Accepted Submission(s): 9
Problem Description

The weather is turning cold, and everyone wears their own ancestral Check shirt.
But there are always some people wear the Check shirts which can do harm to our eyesight, causing discomfort.

Now there are n computer programmers sitting in the room. Each programmer’s Check shirt is composed of two colors, given by RGB format. Now, please find out the programmer who wears the most harmful shirt, and the others will throw him out immediately.
After your consideration, for the two colors RGB (r1, g1, b1), RGB (r2, g2, b2), the one with the highest value of |r1-r2|+|g1-g2| is the one to be thrown out.

Input

Only one test case.
The first line of the input contains an integer n.
Each of the following n lines contains six integers:
r1, g1, b1, r2, g2, b2
denoting the two colors on the Check shirt of each programmer.

0 <n <= 100,0 <=r, g, b <= 255.

Output

Just print a single line containing an integer i, representing that the i-th programmer will be thrown out.

Sample Input
3
160 180 240 80 120 200
255 0 0 0 255 0
0 0 0 50 50 0
Sample Output
2
Hint

It’s guaranteed that there won't be multiple answers

Source

2018市赛