
$("#button").click(function(){
	var flatsOnFloor = parseInt($('#flats-on-floor').val());
	var floors = parseInt($('#floors').val());
	var flat = parseInt($('#flat').val());
	flatsOnEntrance = flatsOnFloor * floors;
	var entrance = Math.ceil(flat / flatsOnEntrance);
	var floor = Math.ceil((flat  - flatsOnEntrance * (entrance - 1)) / flatsOnFloor);
	$('#result').html(entrance + " подъезд, " + floor + " этаж");
	return false;
});