if(t>n /*&& count==half*/) //the count==half is not necessary { sum++; for(int temp=1;temp