Yet Another FFT Problem?
题号:NC241122
时间限制:C/C++/Rust/Pascal 4秒,其他语言8秒
空间限制:C/C++/Rust/Pascal 1024 M,其他语言2048 M
Special Judge, 64bit IO Format: %lld

题目描述

triplea and tripleb have two integer arrays and , respectively. One day they came up with the following problem:
  • Does there exists a pair of numbers in arrays A and B, such that their absolute difference is the same?

However, triplea and tripleb care about their data privacy, so they don't want to expose their array directly to each other. That's why they turn to you------triplec. Can you help them solve this problem?

Formally, you need to determine: do there exist four indices , such that , and .

输入描述:

The first line contains two integers , denoting the sizes of array A and B, respectively.

The next line contains n integers , denoting the elements of array A.

The next line contains m integers , denoting the elements of array B.

输出描述:

If there exist four indices , such that ,  and , output i,j,k,l in a line, otherwise output -1 in a line.
示例1

输入

复制
4 4
2 4 8 16
3 9 27 81

输出

复制
1 3 1 2