시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB67443665.455%

문제

Two fractions are considered “neighbors” if the numerator of the reduced positive difference between the two fractions is 1. For example, the fractions 1/11 and 1/12 subtract to be 1/132, and are therefore “neighbors”. However, 2/5 and 4/5 differ by 2/5, and are not neighbors. Determine and output either the “neighbor” fraction value, or output “NOT NEIGHBORS”.

입력

The first line of input contains a single positive integer, n, indication the number of data sets. Each data set is comprised of the positive integer values for two fractions, all on one line, in the order numerator, denominator, numerator, denominator, separated by single spaces.

출력

The positive “neighbor” difference between the two fractions or the phrase “NOT NEIGHBORS”.

예제 입력 1

3
1 11 1 12
20 19 19 19
2 5 4 5

예제 출력 1

1/132
1/19
NOT NEIGHBORS