#C10150. Count Unique Pairs with Target Sum

    ID: 39324 Type: Default 1000ms 256MiB

Count Unique Pairs with Target Sum

Count Unique Pairs with Target Sum

Given an array of integers and a target sum, your task is to determine the number of unique pairs of integers in the array that add up to the target. Each pair is defined as \( (\min(a,b),\max(a,b)) \) to ensure uniqueness, meaning that pairs like (a, b) and (b, a) are considered the same.

You are required to read the input from standard input and write the output to standard output.

inputFormat

The input consists of two lines. The first line contains two integers n and target, where n is the number of elements in the array, and target is the target sum.

The second line contains n space-separated integers representing the elements of the array.

outputFormat

Output a single integer which is the count of unique pairs in the array whose sum equals the target value.

## sample
5 6
1 5 7 -1 5
2