CF34A.Reconnaissance 2
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
n soldiers stand in a circle. For each soldier his height ai is known. A reconnaissance unit can be made of such two neighbouring soldiers, whose heights difference is minimal, i.e. ∣ai−aj∣ is minimal. So each of them will be less noticeable with the other. Output any pair of soldiers that can form a reconnaissance unit.
输入格式
The first line contains integer n ( 2<=n<=100 ) — amount of soldiers. Then follow the heights of the soldiers in their order in the circle — n space-separated integers a1,a2,...,an ( 1<=ai<=1000 ). The soldier heights are given in clockwise or counterclockwise direction.
输出格式
Output two integers — indexes of neighbouring soldiers, who should form a reconnaissance unit. If there are many optimum solutions, output any of them. Remember, that the soldiers stand in a circle.
输入输出样例
输入#1
5 10 12 13 15 10
输出#1
5 1
输入#2
4 10 20 30 40
输出#2
1 2