calculate minimum x pan