[Question]
  [
Write a program or function that takes in a nonempty list of positive integers. You may assume it is input in a reasonable convenient format such as `"1 2 3 4"` or `[1, 2, 3, 4]`.
The numbers in the input list represent the slices of a full [pie chart](https://en.wikipedia.org/wiki/Pie_chart) where each slice size is proportional to its corresponding number and all slices are arranged around the chart in the order given.
For example, the pie for `1 2 3 4` is:
[![1 2 3 4 example](https://i.stack.imgur.com/mzzd1.png)](https://i.stack.imgur.com/mzzd1.png)
The question your code must answer is: **Is the pie chart ever [bisected](https://en.wikipedia.org/wiki/Bisection)?** That is, is there ever a perfectly straight line from one side of the circle to the other, splitting it symmetrically in two?
You need to **output a [truthy](https://codegolf.meta.stackexchange.com/questions/2190/interpretation-of-truthy-falsey) value if there is at least one bisector and output a [falsy](https://codegolf.meta.stackexchange.com/questions/2190/interpretation-of-truthy-falsey) value if there are none**.
In the `1 2 3 4` example there is a bisection between `4 1` and `2 3` so the output would be truthy.
But for input `1 2 3 4 5` there is no bisector so the output would be falsy:
[![1 2 3 4 5 example](https://i.stack.imgur.com/p0IfP.png)](https://i.stack.imgur.com/p0IfP.png)
# Additional Examples
Arranging numbers differently may remove bisectors.  
e.g. `2 1 3 4` → falsy:
[![2 1 3 4 example](https://i.stack.imgur.com/l2JBi.png)](https://i.stack.imgur.com/l2JBi.png)
If only one number is in the input list the pie is not bisected.  
e.g. `10` → falsy:
[![10 example](https://i.stack.imgur.com/0ruNz.png)](https://i.stack.imgur.com/0ruNz.png)
There may be multiple bisectors. As long as there are more than zero the output is truthy.  
e.g. `6 6 12 12 12 11 1 12` → truthy: (there are 3 bisectors here)
[![6 6 12 12 12 11 1 12 example](https://i.stack.imgur.com/14ggt.png)](https://i.stack.imgur.com/14ggt.png)
Bisections may exist even if they are not visually obvious.  
e.g. `1000000 1000001` → falsy:
[![1000000 1000001 example](https://i.stack.imgur.com/uNck3.png)](https://i.stack.imgur.com/uNck3.png)
e.g. `1000000 1000001 1` → truthy:
[![1000000 1000001 1 example](https://i.stack.imgur.com/H5Wpe.png)](https://i.stack.imgur.com/H5Wpe.png)
(Thanks to [nces.ed.gov](https://nces.ed.gov/nceskids/graphing/classic/bar_pie_data.asp?ChartType=pie&b=15) for generating the pie charts.)
# Test Cases
```
Truthy
1 2 3 4
6 6 12 12 12 11 1 12
1000000 1000001 1
1 2 3
1 1
42 42
1 17 9 13 2 7 3
3 1 2
10 20 10
Falsy
1 2 3 4 5
2 1 3 4
10
1000000 1000001
1
1 2
3 1 1
1 2 1 2 1 2
10 20 10 1
```
# Scoring
The shortest code in bytes wins. Tiebreaker is earlier answer.
  
[Answer]
# J, 18 bytes
5 bytes thanks to Dennis.
```
+/e.[:,/2*+/\-/+/\
```
[@HelkaHomba](https://codegolf.stackexchange.com/questions/81235/has-my-pie-been-bisected/81244#comment199424_81238): Nope.
### Usage
```
>> f =: +/e.[:,/2*+/\-/+/\
>> f 6 6 12 12 12 11 1 12
<< 4
>> f 10 20 10 1
<< 0
```
### Ungolfed
```
black_magic  =: +/\-/+/\
doubled_bm   =: 2 * black_magic
flatten      =: ,/
sum          =: +/
is_member_of =: e.
f =: sum is_member_of monadic flatten doubled_bm
```
---
## Previous 23-byte version:
```
[:+/[:+/+/=+:@-/~@(+/\)
```
### Usage
```
>> f =: [:+/[:+/+/=+:@-/~@(+/\)
>> f 6 6 12 12 12 11 1 12
<< 4
>> f 10 20 10 1
<< 0
```
### Ungolfed
```
black_magic =: -/~@(+/\)
double      =: +:
equals      =: =
sum         =: +/
monadic     =: [:
of          =: @
f =: monadic sum monadic sum (sum equals double of black_magic)
```
---
## Explanation
The sum of all substrings is calculated by the black\_magic. The `+/\` calculate the partial sums.
For example, `a b c d` becomes `a a+b a+b+c a+b+c+d`.
The `-/~` then constructs a subtraction table based on the input, so `x y z` becomes:
```
x-x x-y x-z
y-x y-y y-z
z-x z-y z-z
```
When applied to `a a+b a+b+c a+b+c+d`, the result would be:
```
    0  -b -b-c -b-c-d
    b   0   -c   -c-d
  b+c   c    0     -d
b+c+d c+d    d      0
```
This calculated the sums of all the substrings which does not contain `a`.
This guarantees to be enough, since if one bisection contains `a`, the other bisection will not contain `a` and also will not wrap around.
[Answer]
# [Jelly](http://github.com/DennisMitchell/jelly), ~~9~~ 8 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
Ḥ+\©_Sf®
```
Return a non-empty list (truthy) or an empty list (falsy). [Try it online!](http://jelly.tryitonline.net/#code=4bikK1zCqV9TZsKu&input=&args=WzEsIDIsIDMsIDRd) or [verify all test cases](http://jelly.tryitonline.net/#code=4bikK1zCqV9TZsKuCsOH4oKsRw&input=&args=W1sxLDIsMyw0XSwgWzYsNiwxMiwxMiwxMiwxMSwxLDEyXSwgWzEwMDAwMDAsMTAwMDAwMSwxXSwgWzEsMiwzXSwgWzEsMV0sIFs0Miw0Ml0sIFsxLDE3LDksMTMsMiw3LDNdLCBbMywxLDJdLCBbMTAsMjAsMTBdLCBbMSwyLDMsNCw1XSwgWzIsMSwzLDRdLCBbMTBdLCBbMTAwMDAwMCwxMDAwMDAxXSwgWzFdLCBbMSwyXSwgWzMsMSwxXSwgWzEsMiwxLDIsMSwyXSwgWzEwLDIwLDEwLDFdXQ).
### How it works
```
Ḥ+\©_Sf®  Main link. Argument: A (list)
Ḥ         Double all integers in A.
 +\       Take the cumulative sum of 2A.
   ©      Copy; store the result in the register.
    _S    Subtract the sum of A from each partial sum of 2A.
      f®  Filter; intersect this list with the list in the register.
```
[Answer]
# Julia, ~~34~~ ~~30~~ 29 bytes
```
!x=sum(x)∈cumsum!(x,2x).-x'
```
*Thanks to @GlenO for golfing off 1 byte!*
[Try it online!](http://julia.tryitonline.net/#code=IXg9eHw-c3Vt4oiIKHQ9Mnh8PmN1bXN1bSkuLXQnCgpmb3IgeCBpbiAoCiAgICBbMSwyLDMsNF0sCiAgICBbNiw2LDEyLDEyLDEyLDExLDEsMTJdLAogICAgWzEwMDAwMDAsMTAwMDAwMSwxXSwKICAgIFsxLDIsM10sCiAgICBbMSwxXSwKICAgIFs0Miw0Ml0sCiAgICBbMSwxNyw5LDEzLDIsNywzXSwKICAgIFszLDEsMl0sCiAgICBbMTAsMjAsMTBdLAogICAgWzEsMiwzLDQsNV0sCiAgICBbMiwxLDMsNF0sCiAgICBbMTBdLAogICAgWzEwMDAwMDAsMTAwMDAwMV0sCiAgICBbMV0sCiAgICBbMSwyXSwKICAgIFszLDEsMV0sCiAgICBbMSwyLDEsMiwxLDJdLAogICAgWzEwLDIwLDEwLDFdCikKICAgIHByaW50bG4oIXgpCmVuZA&input=)
### How it works
After storing the cumulative sum of **2x** in **x**, we subtract the row vector **x'** from the column vector **x**, yielding the matrix of all possible differences. Essentially, this computes the sums of all adjacent subarrays of **x** that do not contain the first value, their negatives, and **0**'s in the diagonal.
Finally, we test if the sum of the original array **x** belongs to the generated matrix. If this is the case, the sum of at least one of the adjacent sublists is equal to exactly halve of the sum of the entire list, meaning that there is at least one bisector.
[Answer]
## Haskell, 41 bytes
```
f l=elem(sum l/2)$scanr(:)[]l>>=scanl(+)0
```
The idea is to check whether there is a sublist of `l` whose sum equals `sum l/2`. We generate the sums of these sublists as `scanr(:)[]l>>=scanl(+)0`. Let's look at how this works with `l=[1,2,3]`
```
>> scanr(:)[]l
[[1,2,3],[2,3],[3],[]] 
-- the suffixes of l
>> scanl(+)0 [2,3,4]
[0,2,5,9]
-- the cumulative sums of the input
>> scanr(:)[]l>>=scanl(+)0
[0,1,3,6,0,2,5,0,3,0]
-- the cumulative sums of the suffixes of l, flattened to a single list
```
**Old 43 bytes:**
```
f l|c<-scanl1(+)l=elem(sum l/2)$(-)<$>c<*>c
```
Generates the list `c` of cumulative sums. Then, checks if any two of these sums differ by `sum l/2` by checking if it is an element of the list of differences `(-)<$>c<*>c`.
[Answer]
## Python 2, 64 bytes
```
f=lambda l,s=0:l>[]and(sum(l)==s)|f(l[1:],s+l[0])|f(l,s+l.pop())
```
Recursively tries to remove elements from the front or end until the sum of what remains equals the sum of what was deleted, which is stored is `s`. Takes time exponential in the list length.
Dennis saved 3 bytes with `pop`.
[Answer]
# Pyth, ~~10~~ 9 bytes
```
}sQmysd.:
```
Test it in the [Pyth Compiler](https://pyth.herokuapp.com/?code=%7DsQmysd.%3A&test_suite=1&test_suite_input=%5B1%2C+2%2C+3%2C+4%5D%0A%5B6%2C+6%2C+12%2C+12%2C+12%2C+11%2C+1%2C+12%5D%0A%5B1000000%2C+1000001%2C+1%5D%0A%5B1%2C+2%2C+3%5D%0A%5B1%2C+1%5D%0A%5B42%2C+42%5D%0A%5B1%2C+17%2C+9%2C+13%2C+2%2C+7%2C+3%5D%0A%5B3%2C+1%2C+2%5D%0A%5B10%2C+20%2C+10%5D%0A%5B1%2C+2%2C+3%2C+4%2C+5%5D%0A%5B2%2C+1%2C+3%2C+4%5D%0A%5B10%5D%0A%5B1000000%2C+1000001%5D%0A%5B1%5D%0A%5B1%2C+2%5D%0A%5B3%2C+1%2C+1%5D%0A%5B1%2C+2%2C+1%2C+2%2C+1%2C+2%5D%0A%5B10%2C+20%2C+10%2C+1%5D&debug=0).
### How it works
```
       .:  Generate the list of all adjacent sublists.
   m       Map over the result:
     sd       Add the integers of the sublist.
    y         Double the sum.
 sQ        Compute the sum of the input.
}          Check if it belongs to the list of doubled sublist sums.
```
[Answer]
## Actually, 21 bytes
```
;Σ@2*;lR@τ╗`╜V♂Σi`Míu
```
[Try it online!](http://actually.tryitonline.net/#code=O86jQDIqO2xSQM-E4pWXYOKVnFbimYLOo2lgTcOtdQ&input=MSwyLDMsNA)
This program prints out a `0` for false cases, and a positive integer for true cases.
Explanation:
```
;Σ@2*;lR@τ╗`╜V♂Σi`Míu
;Σ                     sum of copy of input
  @2*                  double values in other copy
     ;lR               copy, range(1, len(input)+1)
        @τ             append other copy to itself
          ╗            save in reg0
           `╜V♂Σi`M    map: generate cyclic cumulative sums
                   íu  1-based index of sum of input (0 if not found)
```
## Non-competing version, 10 bytes
```
;Σ@2*σ;)-∩
```
[Try it online!](http://actually.tryitonline.net/#code=O86jQDIqz4M7KS3iiKk&input=MSwyLDMsNA)
This program outputs an empty list for false cases and a non-empty list otherwise. It is essentially a port of [Dennis's Jelly answer](https://codegolf.stackexchange.com/a/81236/45941). It is non-competing because the cumulative sum and vectorized difference functionality post-date the challenge.
Explanation:
```
;Σ@2*σ;)-∩
;Σ          sum of copy of input
  @2*       multiply values in other copy by 2
     σ;     two copies of cumulative sum
       )-   subtract sum of input from each element in one copy
         ∩  set intersection with other copy
```
[Answer]
# Python 2, ~~76~~ ~~74~~ ~~70~~ 66 bytes
```
def f(x):n=sum(x);print n in[2*sum(x[k/n:k%n])for k in range(n*n)]
```
*Thanks to @xnor for golfing off ~~4~~ 8 bytes!*
Test it on [Ideone](http://ideone.com/2NYxLg). (larger test cases excluded)
[Answer]
# [Python 2](https://docs.python.org/2/), 47 bytes
```
k=t=1
for x in input():t<<=x;k|=t*t
print k&k/t
```
[Try it online!](https://tio.run/##TY3dCoMwDIXvfYrixdjGgZnaKXP2SWRXw6F0qEhkDvbuLqsVRpLm5@tJhjc3faeXV9M@a0VFPdf3OI4XZ9lS9OhHNau2Ex8m3h8KLks7X93H8pGjYWw7Vm7nTrz8NBVBI4W5RVWGDKQ3J4hpGfsPPpO8RsOsU8pxAaVCc89TEXiSQCegZJPC4Cy1rAx3VrTioAsdQvxtEfQF "Python 2 – Try It Online")
I'm back 2.75 years later to beat my [old solution](https://codegolf.stackexchange.com/a/81246/20260) by over 25% using a new method.
This 1-byte longer version is a little clearer.
```
k=t=0
for x in input():t+=x;k|=4**t
print k&k>>t
```
[Try it online!](https://tio.run/##TY3dDoIwDIXveYqFC6N4LtYxIWLGixCvDAYyMwiZERPfHesYiWm7/nw77fj23eDU8ur6Ryuoauf2lqbpYo03MrkPk5hF79jHp98fKn8088V@jM4yn4xT77ywO1vXfvmJGoJCDn1NmgIFSG1OYFM8Dh9CJn61gl6nVOIMypmWgecsCERCSZDcpNA4cc0r450VrTjqYocYf1sYfQE "Python 2 – Try It Online")
The idea is to store the set of cumulative sums `t` as bits of `k`, setting bit `2*t` to indicate that `t` is a cumulative sum. Then, we check if any two cumulative sums differ by half the list sum (final `t`) by bit-shifting `k` this much and doing bitwise `&` with the original to see the result is nonzero (truthy).
[Answer]
# [MATL](https://github.com/lmendo/MATL), 10 bytes
```
EYst!-Gs=z
```
The output is the number of bisectors.
[**Try it online!**](http://matl.tryitonline.net/#code=RVlzdCEtR3M9eg&input=WzEgMiAzIDRd)
### Explanation
Same approach as [Dennis' Julia answer](https://codegolf.stackexchange.com/a/81238/36398).
```
E       % Implicit input. Multiply by 2 element-wise 
Ys      % Cumulative sum 
t!-     % Compute all pairwise differences. Gives a 2D array 
Gs      % Sum of input 
=       % Test for equality, element-wise 
z       % Number of nonzero elements. Implicit display 
```
[Answer]
# Ruby, ~~60~~ 53 bytes
```
->a{a.any?{r=eval a*?+;a.rotate!.any?{|i|0==r-=2*i}}}
```
Generates all possible partitions by taking every rotation of the input array and then taking all slices of length 1..`n`, where `n` is the size of the input array. Then checks if there exists any partition with a sum half the total sum of the input array.
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal), 6 bytes
```
¦Dt½-∩
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=&code=%C2%A6Dt%C2%BD-%E2%88%A9&inputs=%5B1%2C2%2C3%2C4%5D%2C%5B1%2C2%2C3%2C4%2C5%5D%2C%5B6%2C6%2C12%2C12%2C12%2C11%2C1%2C12%5D%2C%5B2%2C1%2C3%2C4%5D%2C%5B1000000%2C1000001%2C1%5D%2C%5B10%5D%2C%5B1%2C2%2C3%5D%2C%5B1000000%2C1000001%5D%2C%5B1%2C1%5D%2C%5B1%5D%2C%5B42%2C42%5D%2C%5B1%2C2%5D%2C%5B1%2C17%2C9%2C13%2C2%2C7%2C3%5D%2C%5B3%2C1%2C1%5D%2C%5B3%2C1%2C2%5D%2C%5B1%2C2%2C1%2C2%2C1%2C2%5D%2C%5B10%2C20%2C10%5D%2C%5B10%2C20%2C10%2C1%5D&header=%C6%9B&footer=%5B1%7C0%5D%3B)
As in Jelly, a list is falsy iff it is empty.
```
¦         Push the cumulative sums
 D        three times.
  t       Take the last one,
   ½      halve it,
    -     subtract it from each of the cumulative sums, 
     ∩    and take the intersection of the differences and the cumulative sums.
```
[Answer]
## JavaScript (ES6), 83 bytes
```
a=>a.map(_=>a.slice(--n).map(m=>s.push(t+=m),t=0),s=[],n=a.length)&&s.includes(t/2)
```
Generates all possible sums, then checks to see whether half of the last sum (which is the sum of the whole list) appears in the list. (Generating the sums in the slightly awkward order to arrange for the sum I need to be last saves 4 bytes.)
[Answer]
# Dyalog APL, 12 bytes
```
+/∊2×+\∘.-+\
```
Test it with [TryAPL](http://tryapl.org/?a=f%20%u2190%20+/%u220A2%D7+%5C%u2218.-+%5C%20%u22C4%20f%A8%A8%28%28%u23734%29%282%203%201%201%201/6%2012%2011%201%2012%29%281e6%281e6+1%291%29%281%202%203%29%281%201%29%2842%2042%29%281%2017%209%2013%202%207%203%29%283%201%202%29%2810%2020%2010%29%29%20%28%28%u23735%29%282%201%203%204%29%28%2C10%29%281e6+0%201%29%28%2C1%29%28%u23732%29%283%201%201%29%286%u23741%202%29%2810%2020%2010%201%29%29&run).
### How it works
```
+/∊2×+\∘.-+\  Monadic function train. Right argument: y (vector)
     +\   +\  Yield the cumulative sum of y.
       ∘.-    Compute all differences of all partial sums.
              This computes the sums of all adjacent subvectors of y that do not
              contain the first value, their negatives, and 0's in the diagonal.
   2×         Multiply all differences by 2.
+/            Yield the sum of y.
  ∊           Test for membership.
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes
```
ÄḤf_¥S
```
[Try it online!](https://tio.run/##y0rNyan8//9wy8MdS9LiDy0N/n@4/VHTmsj//6MNdYx0jHVMYnVgLB1TINtMx0zH0AiGDHWA0AgoDGTDFBuAgQ6EBkqDxWCmYCoAy4BJIDYx0jExgqiFiJvrWOoYGgN1moP1GutA1IJoqDodKAabrGMEMheJCVQNAA "Jelly – Try It Online")
Jelly has gained a single-byte builtin for cumulative sums since Dennis posted his solution, making it trivial to golf to 7 bytes. Turns out there's a lot of creative ways to tie 7, but to hit 6 all it takes is restructuring it with a dyadic chain.
```
 Ḥ        Double
Ä         the cumulative sums,
  f       then filter them by membership in
   _¥     the differences between them and
     S    the total sum.
```
As Dennis presumably observed, a difference of partial sums is the sum of a substring, and if a difference of partial sums is half the total sum, the difference of a partial sum and the total sum is another partial sum.
[Answer]
# Haskell, 68 bytes
```
f l|x<-[0..length l]=any(sum l==)[2*(sum$take a$drop b l)|a<-x,b<-x]
```
The function `f` first creates a list of the sums of all the possible slices of the given list. Then it compares to the total sum of list elements. If we get at some point half of the total sum, then we know that we've got a bisection. I'm also using the fact that if you `take` or `drop` more elements than there are in the list, Haskell does not throw an error.
[Answer]
# APL, 25 chars
~~Assuming the list is given in `X ← 1 2 3 4`.~~
```
(+/X)∊∘.{2×+/⍺↑⍵↓X,X}⍨⍳⍴X←⎕
```
## Explanation:
First note that APL evaluates form right to left. Then:
* `X←⎕` takes the user input and stores it in `X`
* `⍴X` gives the length of `X`
* `⍳⍴X` the numbers from 1 to `⍴X`
* The `⍺` and `⍵` in `{2×+/⍺↑⍵↓X,X}` are the left and right argument
to a dyadic function we are defining inside the braces.
	+ Now for the `⍺↑⍵↓X,X` part:
	`X,X` just concatenates X with itself; `↑` and `↓` are take and drop.
	+ `+/` reduces/folds `+` over the list on its rightSo `2 {2×+/⍺↑⍵↓X,X} 1` = `2×+/2↑1↓X,X` = `2×+/2↑1↓1 2 3 4 1 2 3 4` =
= `2×+/2↑2 3 4 1 2 3 4` = `2×+/2 3` = `2×5` = `10`.
* `∘.brace⍨idx` is just `idx ∘.brace idx`. (`⍨` is the diagonal map; `∘.` is the outer product)
So this gives us a `⍴X` by `⍴X` matrix which contains twice the sums of all connected sublists.
```
 4  6  8  2
10 14 10  6
18 16 14 12
20 20 20 20
```
The last thing we have to do is to check if the sum of `X` is somewhere inside this matrix.
* Which we do with `(+/X)∊matrix`.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 6 bytes
```
sj+~+?
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFSuVv2obcOjpuZHHcuVSopKU5VqQKy0xJziVKXaciU9BaWHuzprH26d8L84S7tO2/7//@hoQx0jHWMdk1gdGEvHFMg20zHTMTSCIUMdIDQCCgPZMMUGYKADoYHSYDGYKZgKwDJgEohNjHRMjCBqIeLmOpY6hsZAneZgvcY6ELUgGqpOB4rBJusYgcxFYgJVxwIA "Brachylog – Try It Online")
Outputs through success or failure, printing [`true.`](https://tio.run/##SypKTM6ozMlPN/r/vzhLu07b/v//aDMdMx1DIxgy1AFCo1gA) or [`false.`](https://tio.run/##SypKTM6ozMlPN/r/vzhLu07b/v//aCMdQx1jHZNYAA) if run as a program. 
```
s         A contiguous sublist of the input
 j        with all of its items duplicated
  +       sums to
   ~+     the sum of the elements of
     ?    the input.
```
[Answer]
# C, 161 145 129 bytes
* saved few bytes thanks to @LeakyNun
* saved few bytes thanks to @ceilingcat
```
i;j;k;t;r;s;f(x,n)int*x;{for(t=i=k=r=0;i<n;)t+=x[i++];for(;++k<n;i=n)for(;i--;r|=2*s==t)for(s=0,j=i;j<i+k;)s+=x[j++%n];return r;}
```
**Ungolfed** [try online](http://ideone.com/LlStyX)
```
int f(int*x,int n)
{
    int t=0;
    for(int i=0;i<n;i++)
    {
        t += x[i];
    }
    for(int k=1;k<n;k++) // subset-size
    {
        for(int i=0,s;i<n;i++) // where to start
        {
            s=0;
            for(int j=i;j<i+k;j++) // sum the subset
            {
                s+=x[j%n];
            }
            if(2*s==t) return 1; // TRUE
        }
    }
    return 0; // FALSE
}
```
[Answer]
## Mathematica, 48 bytes
```
!FreeQ[Outer[Plus,#,-#],Last@#/2]&@Accumulate@#&
```
Anonymous function, similar in action to the numerous other answers.
`Outer[Plus, #, -#]`, when acting on `Accumulate@#` (which in turn acts on the input list, giving a list of successive totals) generates essentially the same table, as at the bottom of Leaky Nun's answer.
`!FreeQ[..., Last@#/2]` checks if `(Last@#)/2` is *not* absent from the resulting table, and `Last@#` is the last of the successive totals, i.e. the sum of all elements of the input list.
If this answer is somewhat interesting, it is not because of a new algorithm, but more about the tricks specific to Mathematica; e.g. `!FreeQ` is nice, compared to `MemberQ`, since it does not require a flattening of the table it checks *and* it saves a byte.
[Answer]
# APL(NARS), chars 95, bytes 190
```
{1≥k←≢w←⍵:0⋄s←+/⍵⋄∨/{s=2×s-+/⍵}¨↑¨{⍵⊂w}¨{(k⍴2)⊤⍵}¨{1≥≢⍵:⍵⋄⍵,∇{(1+2×(↑⍵))×2*0..¯2+≢⍵}⍵}2*0..k-1}
```
Consider one array of input of 4 elements: 1 2 3 4. How we can choose the useful for this exercise partition of that set?
Afther some think the partition of these 4 elements we can use are descrived in the binary number on the left:
```
0001,0010,0100,1000 2^(0..4) 1 2 4  8 
0011,0110,1100,                3 6 12
0111,1110,                       7 14
1111                               15
```
(1001 or 1011 ecc could be in that set but already we have 0110 and 0100 ecc)
so one hat just to write one function that from the number of element of the input array build
these binary numbers... it would be:
```
c←{1≥≢⍵:⍵⋄⍵,∇{(1+2×(↑⍵))×2*0..¯2+≢⍵}⍵}
```
that from input 1 2 4 8 [2^0..lenBytesArgument-1] find 3 6 12, 7 14, 15; so find binary of
these numbers and using them find the right partitions of the input array...I tested c function only for that input 4 elements, but seems it is ok for other number of elements...
test:
```
  f←{1≥k←≢w←⍵:0⋄s←+/⍵⋄∨/{s=2×s-+/⍵}¨↑¨{⍵⊂w}¨{(k⍴2)⊤⍵}¨{1≥≢⍵:⍵⋄⍵,∇{(1+2×(↑⍵))×2*0..¯2+≢⍵}⍵}2*0..k-1}
  f¨(1 2 3 4)(6 6 12 12 12 11 1 12)(1000000 1000001 1)(1 2 3)(1 1)(42 42)
1 1 1 1 1 1 
  f¨(1 2 3 4 5)(2 1 3 4)(,10)(1000000 1000001)(,1)(1 2)(3 1 1)
0 0 0 0 0 0 0 
```
]