$(document).ready(function() {
  a=0;
  $('.w').each(function(i) {		
  	a++;
  });
  $('.w').each(function(i) {
		pw = $(this).parent().width();
		nw = Math.floor(pw/a);

		rw = pw-nw*a;
  		nw = nw-1;
		if(i==1){
			nw = nw+rw;
			$(this).css('width',nw+'px');
		}else if(i==(a-1)){
			nw = nw-1;
			$(this).css('width',nw+'px');	
		}else{
			$(this).css('width',nw+'px');	
		}
  });
});
