Bipartite code is not working... please help!

Please check this, it gives core dump error, not sure what to do. The code is given below
Kindly look into it-