atcoder#ABC233D. [ABC233D] Count Interval
[ABC233D] Count Interval
Score : points
Problem Statement
Given is a sequence of length : , and an integer .
How many of the contiguous subsequences of have the sum of ? In other words, how many pairs of integers satisfy all of the conditions below?
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
6 5
8 -3 5 7 0 -4
3
are the three pairs that satisfy the conditions.
2 -1000000000000000
1000000000 -1000000000
0
There may be no pair that satisfies the conditions.