← Home
For problem statement at 1000-1999/1300-1399/1360-1369/1360/problemG.txt this is a correct solution, but verifier at 1000-1999/1300-1399/1360-1369/1360/verifierG.go ends with wrong answer on test 3
expected: YES
1
1
1
1
got: YES
1000
0100
0010
0001 can you fix the verifier? ```go
package main

import (
	"fmt"
	"sort"
	"strconv"
)

func main() {
	var t int
	fmt.Scan(&t)
	for tt := 0; tt < t; tt++ {
		var n, m, a, b int
		fmt.Scan(&n, &m, &a, &b)
		if int64(n)*int64(a) != int64(m)*int64(b) {
			fmt.Println("NO")
			continue
		}
		matrix := make([][]int, n)
		for i := 0; i < n; i++ {
			matrix[i] = make([]int, m)
		}
		rem := make([]int, m)
		for i := 0; i < m; i++ {
			rem[i] = b
		}
		for r := 0; r < n; r++ {
			var cols []int
			for j := 0; j < m; j++ {
				cols = append(cols, j)
			}
			sort.Slice(cols, func(i, k int) bool {
				j1 := cols[i]
				j2 := cols[k]
				if rem[j1] != rem[j2] {
					return rem[j1] > rem[j2]
				}
				return j1 < j2
			})
			count := 0
			for i := 0; i < m && count < a; i++ {
				j := cols[i]
				if rem[j] > 0 {
					matrix[r][j] = 1
					rem[j]--
					count++
				}
			}
		}
		fmt.Println("YES")
		for i := 0; i < n; i++ {
			s := ""
			for j := 0; j < m; j++ {
				s += strconv.Itoa(matrix[i][j])
			}
			fmt.Println(s)
		}
	}
}
```