mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
32 lines
550 B
C++
32 lines
550 B
C++
|
#include<iostream>
|
||
|
#include<cstdio>
|
||
|
using namespace std;
|
||
|
int abs(int a)
|
||
|
{
|
||
|
if(a<0)return -a;
|
||
|
return a;
|
||
|
}
|
||
|
int main()
|
||
|
{
|
||
|
int i,n;
|
||
|
while(scanf("%d",&n)!=EOF)
|
||
|
{
|
||
|
int x,y,max;
|
||
|
scanf("%d%d",&x,&y);
|
||
|
max=abs(y-x);
|
||
|
int xx=1,yy=2;
|
||
|
for(i=2;i<n;i++)
|
||
|
{
|
||
|
x=y;
|
||
|
scanf("%d",&y);
|
||
|
if(abs(y-x)>max)
|
||
|
{
|
||
|
max=abs(y-x);
|
||
|
xx=i;yy=i+1;
|
||
|
}
|
||
|
}
|
||
|
printf("%d %d\n",xx,yy);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|