For problem statement at 1000-1999/1000-1099/1090-1099/1095/problemC.txt this is a correct solution, but verifier at 1000-1999/1000-1099/1090-1099/1095/verifierC.go ends with All tests passed can you fix the verifier? package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
func main() {
var n, k int
fmt.Scan(&n, &k)
counts := make([]int, 32)
currK := 0
for i := 0; i < 31; i++ {
if (n>>i)&1 == 1 {
counts[i]++
currK++
}
}
if k < currK || k > n {
fmt.Println("NO")
return
}
fmt.Println("YES")
need := k - currK
for i := 30; i > 0 && need > 0; i-- {
split := counts[i]
if split > need {
split = need
}
counts[i] -= split
counts[i-1] += 2*split
need -= split
}
writer := bufio.NewWriter(os.Stdout)
for i := 0; i < 31; i++ {
val := strconv.Itoa(1 << i)
for j := 0; j < counts[i]; j++ {
writer.WriteString(val + " ")
}
}
writer.WriteString("\n")
writer.Flush()
}