C++11, 284284 267 bytes
Uses-17 bytes thanks to Zacharý
Uses C++ random library, output on the standard output
#include<iostream>
#include<random>
typedef float z;template<int N>void g(z s){z a[N],d=s/N;int i=0;fori=N;for(;i<N;++i;i;)a[i]=d;stda[--i]=d;std::uniform_real_distribution<z> uuniform_real_distribution<z>u(.0,d<.5?d:1-d);std::default_random_engine e;for(i=1;i<N;++i;i<N;){z c=u(e);a[i-1]+=c;a[i];a[i]+=c;a[++i]-=c;}for(i=0;i<N;++i;i;)std::cout<<a[i]<<'\n';cout<<a[--i]<<' ';}
To call, you just need to do that :
g<2>(0.0);
Where the template parameter ( here, 2 ) is N, and the actual parameter ( here, 0.0 ) is S