无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

CF 34A. Reconnaissance 2

2023-06-10 12:10 作者:您是打尖兒還是住店呢  | 我要投稿

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.


Input

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

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.


判斷有多少個(gè)士兵能組成一個(gè)小組,能組成的限制就是身高差異不能超過D

下面是代碼:


CF 34A. Reconnaissance 2的評論 (共 條)

分享到微博請遵守國家法律
元江| 海门市| 徐水县| 临漳县| 开远市| 祁东县| 平谷区| 抚顺县| 石门县| 边坝县| 尉犁县| 图木舒克市| 油尖旺区| 石棉县| 正阳县| 浦北县| 天柱县| 康定县| 凭祥市| 蒙阴县| 张家川| 彩票| 蒙山县| 阿鲁科尔沁旗| 清新县| 大宁县| 子洲县| 亳州市| 昂仁县| 西乌珠穆沁旗| 额敏县| 保康县| 郁南县| 交口县| 松江区| 凤冈县| 景宁| 高碑店市| 泌阳县| 马尔康县| 辽中县|