← Home
For problem statement at 0-999/300-399/340-349/349/problemB.txt this is a correct solution, but verifier at 0-999/300-399/340-349/349/verifierB.go ends with All 10 tests passed can you fix the verifier?  ```go
package main

import (
    "fmt"
)

func main() {
    var v int
    fmt.Scan(&v)
    
    a := make([]int, 9)
    for i := 0; i < 9; i++ {
        fmt.Scan(&a[i])
    }
    
    minCost := a[0]
    for i := 1; i < 9; i++ {
        if a[i] < minCost {
            minCost = a[i]
        }
    }
    
    if v < minCost {
        fmt.Println(-1)
        return
    }
    
    maxDigits := v / minCost
    remaining := v
    result := make([]byte, maxDigits)
    
    for i := 0; i < maxDigits; i++ {
        for d := 9; d >= 1; d-- {
            cost := a[d-1]
            if int64(remaining-cost) >= int64(maxDigits-i-1)*int64(minCost) {
                result[i] = byte('0' + d)
                remaining -= cost
                break
            }
        }
    }
    
    fmt.Println(string(result))
}
```