int (final Point source, final Point point) { if(source.x >= point.x){ return Integer.MAX_VALUE; } else{ final int scale = (point.y - source.y) <= 0 ? 3 : 4; return (point.x - source.x) + Math.abs(point.y - source.y) * scale; } }