F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

find the max

Time Limit: 1000/1500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1091    Accepted Submission(s): 577


Problem Description
有一个离散函数f(x),x = {1, 2, ,,,,N},f(x)<2^31。现在要找出2个点i,j, 使得函数在这2点之间的点都在这2点连线下方,且此连线的斜率的绝对值越大越好。
 

Input
输入包括多个测试实例。每个测试实例包括2行,第一行为一个整数N,2 <= N <= 100000, 然后是N个整数f(x),x=1,2...N,读到文件结束符为止.
 

Output
对于每个测试实例输出找到的i和j,如果有多个答案,输出字典序最小的一个。
 

Sample Input
3 1 2 3 3 2 6 4
 

Sample Output
1 2 1 2 use scanf to avoid Time Limit Exceeded
 

Hint
Hint
 

Author
8600
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-06-26 18:24:24, Gzip enabled