For problem statement at 1000-1999/1100-1199/1110-1119/1117/problemB.txt this is a correct solution, but verifier at 1000-1999/1100-1199/1110-1119/1117/verifierB.go ends with All tests passed can you fix the verifier? package main
import (
"fmt"
"io"
"os"
)
func main() {
data, _ := io.ReadAll(os.Stdin)
idx := 0
nextInt64 := func() int64 {
for idx < len(data) && (data[idx] == ' ' || data[idx] == '\n' || data[idx] == '\r' || data[idx] == '\t') {
idx++
}
sign := int64(1)
if idx < len(data) && data[idx] == '-' {
sign = -1
idx++
}
var val int64
for idx < len(data) && data[idx] >= '0' && data[idx] <= '9' {
val = val*10 + int64(data[idx]-'0')
idx++
}
return sign * val
}
n := int(nextInt64())
m := nextInt64()
k := nextInt64()
var max1, max2 int64
countMax := 0
for i := 0; i < n; i++ {
x := nextInt64()
if x > max1 {
max2 = max1
max1 = x
countMax = 1
} else if x == max1 {
countMax++
} else if x > max2 {
max2 = x
}
}
var ans int64
if countMax >= 2 {
ans = max1 * m
} else {
cntMax := (m/(k+1))*k + m%(k+1)
ans = cntMax*max1 + (m-cntMax)*max2
}
fmt.Print(ans)
}