CF1500A.Going Home
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
It was the third month of remote learning, Nastya got sick of staying at dormitory, so she decided to return to her hometown. In order to make her trip more entertaining, one of Nastya's friend presented her an integer array a .
Several hours after starting her journey home Nastya remembered about the present. To entertain herself she decided to check, are there four different indices x,y,z,w such that ax+ay=az+aw .
Her train has already arrived the destination, but she still hasn't found the answer. Can you help her unravel the mystery?
输入格式
The first line contains the single integer n ( 4≤n≤200000 ) — the size of the array.
The second line contains n integers a1,a2,…,an ( 1≤ai≤2.5⋅106 ).
输出格式
Print "YES" if there are such four indices, and "NO" otherwise.
If such indices exist, print these indices x , y , z and w ( 1≤x,y,z,w≤n ).
If there are multiple answers, print any of them.
输入输出样例
输入#1
6 2 1 5 2 7 4
输出#1
YES 2 3 1 6
输入#2
5 1 3 1 9 20
输出#2
NO
说明/提示
In the first example a2+a3=1+5=2+4=a1+a6 . Note that there are other answer, for example, 2 3 4 6.
In the second example, we can't choose four indices. The answer 1 2 2 3 is wrong, because indices should be different, despite that a1+a2=1+3=3+1=a2+a3