← Home
For problem statement at 0-999/400-499/440-449/446/problemB.txt this is a correct solution, but verifier at 0-999/400-499/440-449/446/verifierB.go ends with All tests passed can you fix the verifier?  ```go
package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type IntHeap []int64

func (h IntHeap) Len() int { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] > h[j] }
func (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }

func (h *IntHeap) Push(x interface{}) {
	*h = append(*h, x.(int64))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	line, _ := reader.ReadString('\n')
	fields := strings.Fields(line)
	n, _ := strconv.Atoi(fields[0])
	m, _ := strconv.Atoi(fields[1])
	k, _ := strconv.Atoi(fields[2])
	p, _ := strconv.Atoi(fields[3])
	
	rowSums := make([]int64, n)
	colSums := make([]int64, m)
	
	for i := 0; i < n; i++ {
		line, _ = reader.ReadString('\n')
		fields = strings.Fields(line)
		for j := 0; j < m; j++ {
			val, _ := strconv.ParseInt(fields[j], 10, 64)
			rowSums[i] += val
			colSums[j] += val
		}
	}
	
	rowPleasures := make([]int64, k+1)
	colPleasures := make([]int64, k+1)
	
	rh := &IntHeap{}
	heap.Init(rh)
	for _, sum := range rowSums {
		heap.Push(rh, sum)
	}
	
	for i := 1; i <= k; i++ {
		maxVal := heap.Pop(rh).(int64)
		rowPleasures[i] = rowPleasures[i-1] + maxVal
		heap.Push(rh, maxVal - int64(m)*int64(p))
	}
	
	ch := &IntHeap{}
	heap.Init(ch)
	for _, sum := range colSums {
		heap.Push(ch, sum)
	}
	
	for i := 1; i <= k; i++ {
		maxVal := heap.Pop(ch).(int64)
		colPleasures[i] = colPleasures[i-1] + maxVal
		heap.Push(ch, maxVal - int64(n)*int64(p))
	}
	
	var ans int64 = -1 << 60
	for i := 0; i <= k; i++ {
		j := k - i
		val := rowPleasures[i] + colPleasures[j] - int64(i)*int64(j)*int64(p)
		if val > ans {
			ans = val
		}
	}
	
	fmt.Println(ans)
}
```