Sum
시간 제한1초메모리 제한1024 MB
정렬된 배열에서 두 원소의 합이 S인 쌍의 개수를 센다.
문제
Consider an -element strictly increasing integer sequence and an integer .
Write a program to count the number of pairs of elements of whose sum is .
입력
The first line of input contains and , the length of the sequence and the required sum (, ). The following lines contain elements of the sequence, one element () on each line. The elements are distinct and ordered increasingly.
출력
The only line of output should contain the number of pairs that consist of two distinct elemets of the sequence and sum to .