```golang
package main
import "fmt"
import "sync"
type Node struct {
h, w int
}
var (
arr = make([]Node, 1e5)
n, k int
ch = make(chan int)
judge = make(chan bool)
wg sync.WaitGroup
)
func check() {
tot, num := 0, <-ch
for i := 0; i < n; i++ {
tot += (arr[i].h / num) * (arr[i].w / num)
if tot >= k {
judge <- true
return
}
}
judge <- false
}
func main() {
fmt.Scanf("%d %d", &n, &k)
for i := 0; i < n; i++ {
fmt.Scanf("%d %d", &arr[i].h, &arr[i].w)
}
wg.Add(1)
go check()
go func() {
l, r := 1, 100000
for l < r {
mid := (l + r + 1) >> 1
ch <- mid
if <-judge {
l = mid
} else {
r = mid - 1
}
}
ch <- l
wg.Done()
}()
fmt.Println(<-ch)
wg.Wait()
}
```
输入:
```
2 10
5 6
6 5
```
输出:
```
2
```
有疑问加站长微信联系(非本文作者)