← Home
For problem statement at 1000-1999/1500-1599/1500-1509/1508/problemB.txt this is a correct solution, but verifier at 1000-1999/1500-1599/1500-1509/1508/verifierB.go ends with All 100 tests passed can you fix the verifier? ```go
package main

import (
	"bufio"
	"fmt"
	"os"
)

const CAP uint64 = 1000000000000000001

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	const MAXN = 100000 + 5
	pow2 := make([]uint64, MAXN)
	pow2[0] = 1
	for i := 1; i < MAXN; i++ {
		if pow2[i-1] > CAP/2 {
			pow2[i] = CAP
		} else {
			pow2[i] = pow2[i-1] * 2
		}
	}
	count := func(m int) uint64 {
		if m == 0 {
			return 1
		}
		return pow2[m-1]
	}

	var t int
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		var n int
		var k uint64
		fmt.Fscan(in, &n, &k)
		if k > count(n) {
			fmt.Fprintln(out, -1)
			continue
		}
		res := make([]int, 0, n)
		s := 1
		for s <= n {
			e := s
			for {
				m := n - e
				c := count(m)
				if k > c {
					k -= c
					e++
				} else {
					break
				}
			}
			for x := e; x >= s; x-- {
				res = append(res, x)
			}
			s = e + 1
		}
		for i := 0; i < n; i++ {
			if i > 0 {
				fmt.Fprint(out, " ")
			}
			fmt.Fprint(out, res[i])
		}
		fmt.Fprintln(out)
	}
}
```