MXP  Max Power
You are given two sequences of positive integers a1, a2, ..., an and b1, b2, ..., bn of length n each. You are to write a program which finds k such that ak to the power of bk is maximal.
Input
The first line of input contains a positive integer n, not greater than 10000. In the second line you are given a set of positive integers ai separated by spaces, and in the third line – integers bi. All numbers in both sequences are not greater than 10000. It is guaranteed that all power values are different.
Output
The output must contain one number – the answer to the problem.
Score
The score to this problem is equal to (1000  t), where t is the time used by your solution, in milliseconds. If your solution works for more than 1 second then you get 0 points.
Example
Input: 5 1 2 2 3 3 100 1 3 2 1 Output: 4
hide comments
Francky:
20200309 16:02:11
Problem fixed ; thanks to admins. 

nadstratosfer:
20200229 15:27:29
Broken problem, all submissions since Jan'2015 get Internal Error. 

Samil Vargas:
20131224 19:26:51
dont get it 
Added by:  Roman Sol 
Date:  20080313 
Time limit:  0.100s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  ZCon 2008 