#C8300. Prime Sum Pair
Prime Sum Pair
Prime Sum Pair
You are given an array of distinct integers. Your task is to determine whether there exists a pair of distinct numbers in the array such that their sum is a prime number.
A prime number is defined as a natural number greater than 1 that has no divisors other than 1 and itself. In mathematical notation, a number \(p\) is prime if \(p > 1\) and for every integer \(i\) (with \(2 \le i \le p-1\)), \(p \mod i \neq 0\).
If there exists at least one pair whose sum is prime, output 1; otherwise, output 0.
inputFormat
The input is read from stdin and has the following format:
- The first line contains an integer \(N\) denoting the number of elements in the array.
- The second line contains \(N\) space-separated integers representing the array elements.
outputFormat
Output a single integer to stdout: output 1 if there exists any pair of different elements in the array whose sum is a prime number, otherwise output 0.
## sample4
1 4 6 7
1