Bedao Regular Contest 21 - Bộ tứ số

View as PDF

Submit solution


Points: 0.01 (partial)
Time limit: 0.25s
Memory limit: 256M
Input: stdin
Output: stdout

Author:
Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch

Cho một dãy số nguyên dương ~a~ gồm ~n~ phần tử. Hãy tìm bộ số ~(x,y,z,t)~ (đôi một phân biệt) bất kỳ thỏa mãn ~a_x + a_y = a_z + a_t~.

Input

  • Dòng đầu tiên chứa số nguyên ~n~ (~4 \leq n \leq 2 \cdot 10^5~).

  • Dòng thứ hai chứa ~n~ số nguyên ~a_1, a_2, \ldots, a_n~ (~1 \leq a_i \leq 2 \cdot 10^6~).

Output

  • In ra bộ số bất kì thỏa mãn bài toán.

  • Nếu không tồn tại bộ số nào như vậy, in ra ~-1~.

Scoring

Subtask Điểm Giới hạn
1 ~30~ ~n \leq 80~
2 ~70~ Không có ràng buộc gì thêm

Sample Input 1

9
21 13 4 30 30 28 18 5 17

Sample Output 1

1 2 3 4

Sample Input 2

8
25 22 6 24 9 26 25 14

Sample Output 2

1 3 2 5

Comments

Please read the guidelines before commenting.


There are no comments at the moment.