#d2872. 三段式
三段式
Three Sections
Problem Description
You are given a sequence of length . We want to cut it into three contiguous segments so that each segment has the same total sum. Count the number of different ways to do this.
Input Format
The first line gives ().
The second line gives ().
Output Format
Output the number of different ways to cut the sequence.
Sample Input
4
1 2 3 3
Sample Output
1
Sample Explanation
We can split it into the first group , the second group , and the third group .