partendo dall'ultimo elemento fino al secondo:

se (elento[N] %4) < (elento[N-1] %4)
return 0;

fine ciclo

return 1;