For problem statement at 0-999/600-699/640-649/649/problemB.txt this is a correct solution, but verifier at 0-999/600-699/640-649/649/verifierB.go ends with All tests passed can you fix the verifier? package main
import (
"bufio"
"fmt"
"os"
)
func abs(x int64) int64 {
if x < 0 {
return -x
}
return x
}
func min(a, b int64) int64 {
if a < b {
return a
}
return b
}
func floorCost(x, y int64) int64 {
d := abs(x - y)
if d == 0 {
return 0
}
return min(5*d, 10+d)
}
func getPos(apartment, perEntrance, k int64) (int64, int64) {
apartment--
entrance := apartment/perEntrance + 1
floor := (apartment%perEntrance)/k + 1
return entrance, floor
}
func main() {
in := bufio.NewReader(os.Stdin)
out := bufio.NewWriter(os.Stdout)
defer out.Flush()
var n, m, k int64
var a, b int64
fmt.Fscan(in, &n, &m, &k)
fmt.Fscan(in, &a, &b)
perEntrance := m * k
ea, fa := getPos(a, perEntrance, k)
eb, fb := getPos(b, perEntrance, k)
var ans int64
if ea == eb {
ans = floorCost(fa, fb)
} else {
d := abs(ea - eb)
d = min(d, n-d)
ans = floorCost(fa, 1) + 15*d + floorCost(1, fb)
}
fmt.Fprintln(out, ans)
}