For problem statement at 0-999/700-799/720-729/721/problemE.txt this is a correct solution, but verifier at 0-999/700-799/720-729/721/verifierE.go ends with All 105 tests passed can you fix the verifier? package main
import (
"bufio"
"fmt"
"io"
"os"
)
func main() {
data, _ := io.ReadAll(os.Stdin)
idx := 0
nextInt := func() int64 {
n := len(data)
for idx < n && (data[idx] < '0' || data[idx] > '9') && data[idx] != '-' {
idx++
}
sign := int64(1)
if idx < n && data[idx] == '-' {
sign = -1
idx++
}
var val int64
for idx < n && data[idx] >= '0' && data[idx] <= '9' {
val = val*10 + int64(data[idx]-'0')
idx++
}
return val * sign
}
_ = nextInt()
n := int(nextInt())
p := nextInt()
t := nextInt()
var ans int64
var lastEnd int64
hasSong := false
for i := 0; i < n; i++ {
l := nextInt()
r := nextInt()
if !hasSong {
if r-l >= p {
cnt := (r - l) / p
ans += cnt
lastEnd = l + cnt*p
hasSong = true
}
continue
}
start := l
need := lastEnd + t
if start < need {
start = need
}
if r-start >= p {
cnt := (r - start) / p
ans += cnt
lastEnd = start + cnt*p
}
}
out := bufio.NewWriter(os.Stdout)
fmt.Fprint(out, ans)
out.Flush()
}