← Home
For problem statement at 0-999/100-199/160-169/165/problemB.txt this is a correct solution, but verifier at 0-999/100-199/160-169/165/verifierB.go ends with All tests passed can you fix the verifier? ```go
package main

import (
	"fmt"
)

func totalLines(v, k int) int {
	total := 0
	current := v
	for current > 0 {
		total += current
		current = current / k
	}
	return total
}

func main() {
	var n, k int
	fmt.Scan(&n, &k)

	lo, hi := 0, n
	// Find upper bound
	for totalLines(hi, k) < n {
		hi *= 2
	}

	for lo < hi {
		mid := (lo + hi) / 2
		if totalLines(mid, k) >= n {
			hi = mid
		} else {
			lo = mid + 1
		}
	}

	fmt.Println(lo)
}
```