see the compiled code at http://ideone.com/gIWKI1
state the problem which you are trying to solve !!
you dont need the this loop in lines 31 and 48.
because of these for loops variable ‘k’ reaches a value of size*size where as
you have allocated array ‘b’ only ‘size’ ints.
remove these for loops ideone link and you wont get any sigsev error but you will get tle(time limit exceeded).
see the editorial for faster algorithm.
a small suggestion try to write code with indentation as it will help you in reading code and debugging.
I think the question is http://www.codechef.com/problems/ROTATION/