package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func scan(a ...interface{})             { fmt.Fscan(reader, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }

func redirectInputToFile(r *bufio.Reader, fp string) {
	f, err := os.Open(fp)
	if err != nil {
		panic(err)
	}
	r.Reset(f)
}

func main() {
	defer writer.Flush()
// 	redirectInputToFile(reader, "input.txt")

	T := 1
	scan(&T)
	for t := 0; t < T; t++ {
		solve()
	}
}

func solve() {
	var (
		n int
		k int64
	)
	scan(&n, &k)

	var a = make([]int64, n)
	for i := range a {
		scan(&a[i])
	}

	sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })

	var suffsum = make([]int64, n)
	suffsum[n-1] = a[n-1]
	for i := n - 2; i >= 0; i-- {
		suffsum[i] = suffsum[i+1] + a[i]
	}

	var (
		ans int64 = max(0, suffsum[0]-k)
		eq  int64
	)
	for i := len(a) - 1; i >= 1; i-- {
		if a[i] == a[0] {
			eq++
		}
		var (
			cnt = int64(len(a) - i)
			s   = suffsum[0] - suffsum[i] + cnt*a[0]
			res = cnt - eq
		)
		if s > k {
			dmin := (s - k + cnt) / (cnt + 1)
			res = cnt + dmin
		}
		ans = min(ans, res)
	}

	printf("%v\n", ans)
}

func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

func min(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

package main

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

var (
	in  = bufio.NewReader(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
)

const TAM = 2e5 + 100

var n int
var k int64
var a [TAM]int64
var sufSum [TAM]int64
var prefSum [TAM]int64

func min(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

func solveOnlyDecrease() int64 {
	return max(0, prefSum[n]-k)
}

func solveOnlySet() int64 {
	if a[1]*int64(n) > k {
		return prefSum[n]
	}
	var sum = prefSum[n]
	var ans int64 = 0
	for i := n; i >= 0 && sum > k; i-- {
		sum += a[1] - a[i]
		ans++
	}
	return ans
}

func applyOperations(first, prefSum, sets, subtracts int64) int64 {
	return (prefSum - subtracts) + (first-subtracts)*sets
}

func minSubtractOperations(first, prefSum, sets int64) int64 {
	var hi int64 = prefSum
	var lo int64 = 0
	var mi int64

	for lo < hi {
		mi = (lo + hi) / 2

		var sum = applyOperations(first, prefSum, sets, mi)
		if sum > k {
			lo = mi + 1
		} else {
			hi = mi
		}
	}

	return lo
}

func solve() int64 {
	var tmp = a[1:(n + 1)]
	sort.Slice(tmp, func(i, j int) bool {
		return tmp[i] < tmp[j]
	})

	prefSum[0] = 0
	sufSum[n+1] = 0
	for i := 1; i <= n; i++ {
		prefSum[i] = a[i] + prefSum[i-1]
	}

	for i := n; i >= 1; i-- {
		sufSum[i] = a[i] + sufSum[i+1]
	}

	var ans = min(solveOnlySet(), solveOnlyDecrease())
	// fmt.Fprintf(out, "init %d\n", ans)
	for sets := 1; sets < n; sets++ {
		var subs = minSubtractOperations(a[1], prefSum[n-sets], int64(sets))
		// fmt.Fprintf(out, "subs for %d are %d\n", subs, sets)
		ans = min(ans, int64(sets)+subs)
	}
	return ans
}

func main() {
	var ntc int
	fmt.Fscan(in, &ntc)
	for t := 0; t < ntc; t++ {
		fmt.Fscan(in, &n, &k)
		for i := 1; i <= n; i++ {
			fmt.Fscan(in, &a[i])
		}
		fmt.Fprintf(out, "%d\n", solve())
	}
	out.Flush()
}

package main

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

var in = bufio.NewReader(os.Stdin)

func solve() {
	var n int
	var k int64
	fmt.Fscan(in, &n)
	fmt.Fscan(in, &k)

	a := make([]int64, n)
	var aSum int64 = 0
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &a[i])
		aSum += a[i]
	}
	if aSum <= k {
		fmt.Println(0)
		return
	}

	sort.Slice(a, func(i, j int) bool {
		return a[i] < a[j]
	})

	result := aSum - k
	for i := 1; i < n; i++ {
		aSum -= a[n-i] - a[0]

		var decCnt int64 = 0
		if aSum > k {
			minCnt := int64(i + 1)
			decCnt = (aSum - k + minCnt - 1) / minCnt
		}

		cost := decCnt + int64(i)
		if cost < result {
			result = cost
		}
	}
	fmt.Println(result)
}

func main() {
	var t int
	fmt.Fscan(in, &t)

	for i := 0; i < t; i++ {
		solve()
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)
func min(x, y int64)int64{
	if x<y{
		return x
	}
	return y
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := os.Stdout
	var t int
	fmt.Fscan(in,&t)
	for c:=1;c<=t;c++{
		var n int64
		var k int64
		fmt.Fscan(in,&n,&k)
		a := make([]int64,n+5)
		var i int64
		var sum int64
		sum = 0
		for i=1;i<=n;i++{
			fmt.Fscan(in,&a[i])
			sum+=a[i]
		}
		sort.Slice(a[1:n+1],func(i,j int)bool{
			return a[i+1]<a[j+1]
		})
		//fmt.Println(a)
		var l, r int64
		l = 0
		r = 2000000000000000
		var ans int64
		ans = 0
		for l<=r{
			mid := (l+r)>>1
			var cnt int64
			cnt=0
			tar := sum
			for i=n;i>=2;i--{
				if mid<=cnt{
					break
				}
				if a[i]-a[1]+(cnt+2)*(mid-cnt-1)<((cnt+1)*(mid-cnt)){
					break
				}
				tar -= a[i]-a[1]
				cnt++
			}
			tar = tar -(cnt+1)*(mid-cnt)
			if tar<=k{
				ans = mid
				r=mid-1
			}else{
				l=mid+1
			}
		}
		fmt.Fprintln(out,ans)
	}
}

package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func scan(a ...interface{})             { fmt.Fscan(reader, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }

func redirectInputToFile(r *bufio.Reader, fp string) {
	f, err := os.Open(fp)
	if err != nil {
		panic(err)
	}
	r.Reset(f)
}

func main() {
	defer writer.Flush()
// 	redirectInputToFile(reader, "input.txt")

	T := 1
	scan(&T)
	for t := 0; t < T; t++ {
		solve()
	}
}

func solve() {
	var (
		n int
		k int64
	)
	scan(&n, &k)

	var a = make([]int64, n)
	for i := range a {
		scan(&a[i])
	}

	sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })

	if n == 1 {
		printf("%v\n", max(0, a[0]-k))
		return
	}

	var suffsum = make([]int64, n)
	suffsum[n-1] = a[n-1]
	for i := n - 2; i >= 0; i-- {
		suffsum[i] = suffsum[i+1] + a[i]
	}

	var (
		ans int64 = max(0, suffsum[0]-k)
		eq  int64
	)
	for i := len(a) - 1; i >= 1; i-- {
		if a[i] == a[0] {
			eq++
		}
		var (
			cnt = int64(len(a) - i)
			s   = suffsum[0] - suffsum[i] + cnt*a[0]
			res = cnt - eq
		)
		if s > k {
			dmin := (s - k + cnt) / (cnt + 1)
			res = cnt + dmin
		}
		ans = min(ans, res)
	}

	printf("%v\n", ans)
}

func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

func min(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
	"sort"
)

func solve(A []int, K int64) int64 {
	n := len(A)
	if n == 1 {
		return max(0, int64(A[0])-K)
	}
	sort.Ints(A)
	var sum int64

	for _, num := range A {
		sum += int64(num)
	}

	if sum <= K {
		return 0
	}

	var best int64 = sum - K

	sum -= int64(A[0])

	for i := n - 1; i > 0; i-- {
		// decrease first to some m
		// and set A[i...]  to A[0]
		// (n - i + 1) * x + sum <= K
		sum -= int64(A[i])
		x := (K - sum) / int64(n-i+1)
		if x*int64(n-i+1) > (K - sum) {
			x--
		}
		a := max(0, int64(A[0])-x)
		best = min(best, a+int64(n-i))
	}

	return best
}

func min(a, b int64) int64 {
	if a <= b {
		return a
	}
	return b
}

func max(a, b int64) int64 {
	if a >= b {
		return a
	}
	return b
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	var buf bytes.Buffer
	tc := readNum(reader)

	for tc > 0 {
		tc--
		var n int
		var K uint64
		s, _ := reader.ReadBytes('\n')
		pos := readInt(s, 0, &n) + 1
		readUint64(s, pos, &K)
		A := readNNums(reader, n)
		res := solve(A, int64(K))
		buf.WriteString(fmt.Sprintf("%d\n", res))
	}
	fmt.Print(buf.String())
}

func normalize(s string) string {

	for i := len(s); i > 0; i-- {
		if s[i-1] >= 'a' && s[i-1] <= 'z' {
			return s[:i]
		}
	}
	return ""
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
	"strconv"
	"strings"
)

func main() {
	reader := bReader(os.Stdin)
	writer := bWriter(os.Stdout)

	t := readInt(reader)

	for t > 0 {
		n, k := readTwoInt64(reader)
		a := readArrayInt64(reader)

		sort.Slice(a, func(i, j int) bool {
			return a[i] < a[j]
		})

		var sum int64
		for i := int64(0); i < n; i++ {
			sum += a[i]
		}

		ans := int64(2e9)
		for t := int64(0); t < n; t++ {
			partSum := sum + a[0]*t
			cnt := t
			if partSum > k {
				cnt += (partSum - k + t) / (t + 1)
			}

			if ans > cnt {
				ans = cnt
			}

			sum -= a[n-t-1]
		}

		fmt.Fprintln(writer, ans)

		t--
	}

	writer.Flush()
}

func bReader(stdin *os.File) *bufio.Reader {
	return bufio.NewReaderSize(stdin, 16*1024*1024)
}

func bWriter(stdout *os.File) *bufio.Writer {
	return bufio.NewWriterSize(stdout, 16*1024*1024)
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}

func checkError(err error) {
	if err != nil {
		panic(err)
	}
}

func readInt(reader *bufio.Reader) int {
	return int(readInt64(reader))
}

func readInt64(reader *bufio.Reader) int64 {
	value, err := strconv.ParseInt(readLine(reader), 10, 64)
	checkError(err)

	return value
}

func readString(reader *bufio.Reader) string {
	return readLine(reader)
}

func readArrayString(reader *bufio.Reader) []string {
	return strings.Split(strings.TrimSpace(readLine(reader)), " ")
}

func readArrayInt(reader *bufio.Reader) []int {
	arTemp := strings.Split(strings.TrimSpace(readLine(reader)), " ")
	n := len(arTemp)

	var ar []int

	for i := 0; i < n; i++ {
		arItemTemp, err := strconv.ParseInt(arTemp[i], 10, 64)
		checkError(err)
		arItem := int(arItemTemp)
		ar = append(ar, arItem)
	}

	return ar
}

func readArrayInt64(reader *bufio.Reader) []int64 {
	arTemp := strings.Split(strings.TrimSpace(readLine(reader)), " ")
	n := len(arTemp)

	var ar []int64

	for i := 0; i < n; i++ {
		arItemTemp, err := strconv.ParseInt(arTemp[i], 10, 64)
		checkError(err)
		arItem := arItemTemp
		ar = append(ar, arItem)
	}

	return ar
}

func readTwoInt(reader *bufio.Reader) (int, int) {
	ar := readArrayInt(reader)
	return ar[0], ar[1]
}

func readTwoInt64(reader *bufio.Reader) (int64, int64) {
	ar := readArrayInt64(reader)
	return ar[0], ar[1]
}

func readThreeInt(reader *bufio.Reader) (int, int, int) {
	ar := readArrayInt(reader)
	return ar[0], ar[1], ar[2]
}

func readThreeInt64(reader *bufio.Reader) (int64, int64, int64) {
	ar := readArrayInt64(reader)
	return ar[0], ar[1], ar[2]
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
)

var (
	in  = bufio.NewReader(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
	err = bufio.NewWriter(os.Stderr)
)

func main() {
	defer out.Flush()
	//redirectInputToFile(in, "input.txt")

	T := readInt()
	for t := 0; t < T; t++ {
		solve()
	}
}

func solve() {
	xx := readArrInt64()
	n := xx[0]
	target := xx[1]
	arr := readArrInt64()
	sort.Slice(arr, func(i, j int) bool {
		return arr[i] < arr[j]
	})
	prefixSum := make([]int64, n+1)
	for i := int64(0); i < n; i++ {
		prefixSum[i+1] = prefixSum[i] + arr[i]
	}
	//println(prefixSum)
	ans := int64(math.MaxInt)
	for i := int64(0); i < n; i++ {
		if prefixSum[n-i]+arr[0]*i < target {
			ans = min(ans, i)
		} else {
			gap := (prefixSum[n-i] + arr[0]*i - target + i) / (i + 1)
			ans = min(gap+i, ans)
		}
	}
	println(ans)

}

func redirectInputToFile(r *bufio.Reader, fp string) {
	f, err := os.Open(fp)
	if err != nil {
		panic(err)
	}
	r.Reset(f)
}

func reverse(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func min(x, y int64) int64 {
	if x < y {
		return x
	}
	return y
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func readFloat(in *bufio.Reader) float64 {
	nStr := readStr()
	n, _ := strconv.ParseFloat(nStr, 64)
	return n
}

func readInt() int {
	nStr := readStr()
	n, _ := strconv.Atoi(nStr)
	return n
}

func readStr() string {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	return nStr
}

func readLineNumbs() []string {
	line := readStr()
	numbs := strings.Split(line, " ")
	return numbs
}

func readArrInt() []int {
	numbs := readLineNumbs()
	arr := make([]int, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.Atoi(n)
		arr[i] = val
	}
	return arr
}

func readArrFloat() {
	numbs := readLineNumbs()
	arr := make([]float64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseFloat(n, 64)
		arr[i] = val
	}
}

func readArrInt64() []int64 {
	numbs := readLineNumbs()
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

// PRINT
func print(args ...interface{}) {
	fmt.Fprint(out, args...)
	out.Flush()
}

func println(args ...interface{}) {
	fmt.Fprintln(out, args...)
	out.Flush()
}

func printErr(args ...interface{}) {
	fmt.Fprint(err, args...)
	err.Flush()
}

func printlnErr(args ...interface{}) {
	fmt.Fprintln(err, args...)
	err.Flush()
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
	"sort"
)

// github.com/EndlessCheng/codeforces-go
func CF1622C(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T, n int
	var k int64
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n, &k)
		tot := int64(0)
		a := make([]int64, n)
		for i := range a {
			Fscan(in, &a[i])
			tot += a[i]
		}
		sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })
		if tot <= k {
			Fprintln(out, 0)
			continue
		}
		ans := tot - k
		for i, s := n-1, a[0]-ans; i > 0; i-- {
			s += a[i]
			var x int64
			y := int64(n - i + 1)
			if s >= 0 {
				x = s / y
			} else {
				x = (s - y + 1) / y
			}
			x = min(x, a[0])
			ans = min(ans, a[0]-x+y-1)
		}
		Fprintln(out, ans)
	}
}

func main() { CF1622C(os.Stdin, os.Stdout) }

func min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"sort"
)

func CF1622C(rawIn io.Reader, rawOut io.Writer) {
	in := bufio.NewReader(rawIn)
	out := bufio.NewWriter(rawOut)
	defer out.Flush()

	var cases int
	fmt.Fscan(in, &cases)
	for cc := 0; cc < cases; cc++ {
		var n, k int64
		fmt.Fscan(in, &n, &k)
		arr := make([]int64, n)
		sum := int64(0)
		for i := int64(0); i < n; i++ {
			fmt.Fscan(in, &arr[i])
			sum += arr[i]
		}
		fmt.Fprintln(out, findMinOps(n, k, sum, arr))
	}
}

func findMinOps(n, k, sum int64, arr []int64) int64 {
	if sum <= k {
		return 0
	}
	// Upper bound achieved by only use "reduce by 1" rule
	var result int64 = sum - k

	sort.Slice(arr, func(i, j int) bool {
		return arr[i] < arr[j]
	})

	subsetSum := make([]int64, n)
	subsetSum[0] = arr[0]
	for i := int64(1); i < n; i++ {
		subsetSum[i] = subsetSum[i-1] + arr[i]
	}

	for numSetToMin := int64(1); numSetToMin < n; numSetToMin++ {
		candidate := result
		afterResets := subsetSum[n-numSetToMin-1] + numSetToMin*arr[0]
		if afterResets <= k {
			candidate = numSetToMin
		} else {
			toReduceTotal := subsetSum[n-numSetToMin-1] - arr[0] - k
			reduceMinTarget := -int64(math.Ceil(float64(toReduceTotal) / float64(numSetToMin+1)))
			reduceMin := int64(math.Abs(float64(arr[0] - reduceMinTarget)))

			candidate = reduceMin + numSetToMin
		}

		if candidate < result {
			result = candidate
		}
	}
	return result
}

func main() { CF1622C(os.Stdin, os.Stdout) }

package main

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

var (
	in  = bufio.NewReader(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
	err = bufio.NewWriter(os.Stderr)
)

func solve(t int) {
	n := readInt()
	k := readInt64()
	a := make([]int64, n)
	var sum int64 = 0

	for i := 0; i < n; i++ {
		a[i] = readInt64()
		sum += a[i]
	}

	if sum <= k {
		println(0)
		return
	}
	var result int64 = sum - k

	sort.Slice(a, func(i, j int) bool {
		return a[i] > a[j]
	})
	var min int64 = a[len(a)-1]

	for i := 0; i < n-1; i++ {
		sum -= a[i] - min
		var candidateResult int64
		if sum > k {
			candidateResult = int64(i+1) + int64((sum-k+int64(i)+1)/int64(i+2))
		} else {
			candidateResult = int64(i + 1)
		}
		if candidateResult < result {
			// println(a, i, sum, k, candidateResult)
			result = candidateResult
		}
	}

	println(result)
}

func main() {
	var t int
	fmt.Fscan(in, &t)

	for i := 0; i < t; i++ {
		solve(i)
	}
}

// READ
func readInt() int {
	var res int
	fmt.Fscan(in, &res)
	return res
}

func readInt64() int64 {
	var res int64
	fmt.Fscan(in, &res)
	return res
}

func readString() string {
	var res string
	fmt.Fscan(in, &res)
	return res
}

// PRINT
func print(args ...interface{}) {
	fmt.Fprint(out, args...)
	out.Flush()
}

func println(args ...interface{}) {
	fmt.Fprintln(out, args...)
	out.Flush()
}

func printErr(args ...interface{}) {
	fmt.Fprint(err, args...)
	err.Flush()
}

func printlnErr(args ...interface{}) {
	fmt.Fprintln(err, args...)
	err.Flush()
}

package main

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

var in = bufio.NewReader(os.Stdin)

func solve() {
	var n int
	var k int64
	fmt.Fscan(in, &n)
	fmt.Fscan(in, &k)

	a := make([]int64, n)
	var aSum int64 = 0
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &a[i])
		aSum += a[i]
	}
	if aSum <= k {
		fmt.Println(0)
		return
	}

	sort.Slice(a, func(i, j int) bool {
		return a[i] < a[j]
	})

	result := aSum - k
	for i := 1; i < n; i++ {
		aSum -= a[n-i] - a[0]

		minCnt := int64(i + 1)
		decCnt := (aSum - k + minCnt - 1) / minCnt

		cost := decCnt + int64(i)
		if cost < result {
			result = cost
		}
	}
	fmt.Println(result)
}

func main() {
	var t int
	fmt.Fscan(in, &t)

	for i := 0; i < t; i++ {
		solve()
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)
func min(x, y int64)int64{
	if x<y{
		return x
	}
	return y
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := os.Stdout
	var t int
	fmt.Fscan(in,&t)
	for c:=1;c<=t;c++{
		var n int64
		var k int64
		fmt.Fscan(in,&n,&k)
		a := make([]int64,n+5)
		var i int64
		var sum int64
		sum = 0
		for i=1;i<=n;i++{
			fmt.Fscan(in,&a[i])
			sum+=a[i]
		}
		sort.Slice(a[1:n+1],func(i,j int)bool{
			return a[i+1]<a[j+1]
		})
		//fmt.Println(a)
		var l, r int64
		l = 0
		r = 2000000000000000
		var ans int64
		ans = 0
		for l<=r{
			mid := (l+r)>>1
			var cnt int64
			cnt=0
			tar := sum
			for i=n;i>=2;i--{
				if a[i]-a[1]+(cnt+2)*(mid-cnt-1)<((cnt+1)*(mid-cnt)){
					break
				}
				tar -= a[i]-a[1]
				cnt++
			}
			tar = tar -(cnt+1)*(mid-cnt)
			if tar<=k{
				ans = mid
				r=mid-1
			}else{
				l=mid+1
			}
		}
		fmt.Fprintln(out,ans)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)
func min(x, y int64)int64{
	if x<y{
		return x
	}
	return y
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := os.Stdout
	var t int
	fmt.Fscan(in,&t)
	for c:=1;c<=t;c++{
		var n int64
		var k int64
		fmt.Fscan(in,&n,&k)
		a := make([]int64,n+5)
		var i int64
		var sum int64
		sum = 0
		for i=1;i<=n;i++{
			fmt.Fscan(in,&a[i])
			sum+=a[i]
		}
		sort.Slice(a[1:n+1],func(i,j int)bool{
			return a[i+1]<a[j+1]
		})
		//fmt.Println(a)
		var l, r int64
		l = 0
		r = 2000000000000000
		var ans int64
		ans = 0
		r = 14
		for l<=r{
			mid := (l+r)>>1
			var cnt int64
			cnt=0
			tar := sum
			for i=n;i>=2;i--{
				if a[i]-a[1]+(cnt+2)*(mid-cnt-1)<((cnt+1)*(mid-cnt)){
					break
				}
				tar -= a[i]-a[1]
				cnt++
			}
			tar = tar -(cnt+1)*(mid-cnt)
			if tar<=k{
				ans = mid
				r=mid-1
			}else{
				l=mid+1
			}
		}
		fmt.Fprintln(out,ans)
	}
}

package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func scan(a ...interface{})             { fmt.Fscan(reader, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }

func redirectInputToFile(r *bufio.Reader, fp string) {
	f, err := os.Open(fp)
	if err != nil {
		panic(err)
	}
	r.Reset(f)
}

func main() {
	defer writer.Flush()
// 	redirectInputToFile(reader, "input.txt")

	T := 1
	scan(&T)
	for t := 0; t < T; t++ {
		solve()
	}
}

func solve() {
	var (
		n int
		k int64
	)
	scan(&n, &k)

	var (
		a = make([]int64, n)
		S int64
	)
	for i := range a {
		scan(&a[i])
		S += a[i]
	}

	sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })

	if n == 1 {
		dx := a[0] - k
		if dx < 0 {
			dx = 0
		}
		printf("%v\n", dx)
		return
	}

	var suffsum = make([]int64, n)
	suffsum[n-1] = a[n-1]
	for i := n - 2; i >= 0; i-- {
		suffsum[i] = suffsum[i+1] + a[i]
	}

	var ans int64 = 1 << 60
	if suffsum[0] <= k {
		ans = 0
	}
	for i := 1; i < len(a); i++ {
		var (
			cnt = int64(len(a) - i)
			s   = S - suffsum[i] + cnt*a[0]
			res = cnt
		)
		if s > k {
			ds := s - k
			dmin := (ds + cnt) / (cnt + 1)
			res += dmin
		}
		if ans > res {
			ans = res
		}
	}

	printf("%v\n", ans)
}

package main

import (
	"bufio"
	"bytes"
	"fmt"
	"math"
	"os"
	"sort"
)

func solve(A []int, K int64) int64 {
	n := len(A)
	if n == 1 {
		return max(0, int64(A[0])-K)
	}
	sort.Ints(A)
	var sum int64

	for _, num := range A {
		sum += int64(num)
	}

	if sum <= K {
		return 0
	}

	var best int64 = math.MaxInt64

	sum -= int64(A[0])

	for i := n - 1; i > 0; i-- {
		// decrease first to some m
		// and set A[i...]  to A[0]
		// (n - i + 1) * x + sum <= K
		sum -= int64(A[i])
		x := (K - sum) / int64(n-i+1)
		if x*int64(n-i+1) > (K - sum) {
			x--
		}
		a := max(0, int64(A[0])-x)
		best = min(best, a+int64(n-i))
	}

	return best
}

func min(a, b int64) int64 {
	if a <= b {
		return a
	}
	return b
}

func max(a, b int64) int64 {
	if a >= b {
		return a
	}
	return b
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	var buf bytes.Buffer
	tc := readNum(reader)

	for tc > 0 {
		tc--
		var n int
		var K uint64
		s, _ := reader.ReadBytes('\n')
		pos := readInt(s, 0, &n) + 1
		readUint64(s, pos, &K)
		A := readNNums(reader, n)
		res := solve(A, int64(K))
		buf.WriteString(fmt.Sprintf("%d\n", res))
	}
	fmt.Print(buf.String())
}

func normalize(s string) string {

	for i := len(s); i > 0; i-- {
		if s[i-1] >= 'a' && s[i-1] <= 'z' {
			return s[:i]
		}
	}
	return ""
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
	"strconv"
	"strings"
)

func main() {
	reader := bReader(os.Stdin)
	writer := bWriter(os.Stdout)

	t := readInt(reader)

	for t > 0 {
		n, k := readTwoInt(reader)
		a := readArrayInt(reader)

		sort.Ints(a)

		sum := 0
		for i := 0; i < n; i++ {
			sum += a[i]
		}

		ans := int(1e9)
		for t := 0; t < n; t++ {
			partSum := sum + a[0]*t
			cnt := t
			if partSum > k {
				cnt += (partSum - k + t) / (t + 1)
			}

			if ans > cnt {
				ans = cnt
			}

			sum -= a[n-t-1]
		}

		fmt.Fprintln(writer, ans)

		t--
	}

	writer.Flush()
}

func sum(a1 int64, n int64) int64 {
	return (2*a1 + (n-1)*4) * n / 2
}

func bReader(stdin *os.File) *bufio.Reader {
	return bufio.NewReaderSize(stdin, 16*1024*1024)
}

func bWriter(stdout *os.File) *bufio.Writer {
	return bufio.NewWriterSize(stdout, 16*1024*1024)
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}

func checkError(err error) {
	if err != nil {
		panic(err)
	}
}

func readInt(reader *bufio.Reader) int {
	return int(readInt64(reader))
}

func readInt64(reader *bufio.Reader) int64 {
	value, err := strconv.ParseInt(readLine(reader), 10, 64)
	checkError(err)

	return value
}

func readString(reader *bufio.Reader) string {
	return readLine(reader)
}

func readArrayString(reader *bufio.Reader) []string {
	return strings.Split(strings.TrimSpace(readLine(reader)), " ")
}

func readArrayInt(reader *bufio.Reader) []int {
	arTemp := strings.Split(strings.TrimSpace(readLine(reader)), " ")
	n := len(arTemp)

	var ar []int

	for i := 0; i < n; i++ {
		arItemTemp, err := strconv.ParseInt(arTemp[i], 10, 64)
		checkError(err)
		arItem := int(arItemTemp)
		ar = append(ar, arItem)
	}

	return ar
}

func readArrayInt64(reader *bufio.Reader) []int64 {
	arTemp := strings.Split(strings.TrimSpace(readLine(reader)), " ")
	n := len(arTemp)

	var ar []int64

	for i := 0; i < n; i++ {
		arItemTemp, err := strconv.ParseInt(arTemp[i], 10, 64)
		checkError(err)
		arItem := arItemTemp
		ar = append(ar, arItem)
	}

	return ar
}

func readTwoInt(reader *bufio.Reader) (int, int) {
	ar := readArrayInt(reader)
	return ar[0], ar[1]
}

func readTwoInt64(reader *bufio.Reader) (int64, int64) {
	ar := readArrayInt64(reader)
	return ar[0], ar[1]
}

func readThreeInt(reader *bufio.Reader) (int, int, int) {
	ar := readArrayInt(reader)
	return ar[0], ar[1], ar[2]
}

func readThreeInt64(reader *bufio.Reader) (int64, int64, int64) {
	ar := readArrayInt64(reader)
	return ar[0], ar[1], ar[2]
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
)

var (
	in  = bufio.NewReader(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
	err = bufio.NewWriter(os.Stderr)
)

func main() {
	defer out.Flush()
	//redirectInputToFile(in, "input.txt")

	T := readInt()
	for t := 0; t < T; t++ {
		solve()
	}
}

func solve() {
	xx := readArrInt()
	n := xx[0]
	target := xx[1]
	arr := readArrInt()
	sort.Ints(arr)
	prefixSum := make([]int, n+1)
	for i := 0; i < n; i++ {
		prefixSum[i+1] = prefixSum[i] + arr[i]
	}
	//println(prefixSum)
	ans := math.MaxInt
	for i := 0; i < n; i++ {
		if prefixSum[n-i]+arr[0]*i < target {
			ans = min(ans, i)
		} else {
			gap := (prefixSum[n-i] + arr[0]*i - target + i) / (i + 1)
			ans = min(gap+i, ans)
		}
	}
	println(ans)

}

func redirectInputToFile(r *bufio.Reader, fp string) {
	f, err := os.Open(fp)
	if err != nil {
		panic(err)
	}
	r.Reset(f)
}

func reverse(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func readFloat(in *bufio.Reader) float64 {
	nStr := readStr()
	n, _ := strconv.ParseFloat(nStr, 64)
	return n
}

func readInt() int {
	nStr := readStr()
	n, _ := strconv.Atoi(nStr)
	return n
}

func readStr() string {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	return nStr
}

func readLineNumbs() []string {
	line := readStr()
	numbs := strings.Split(line, " ")
	return numbs
}

func readArrInt() []int {
	numbs := readLineNumbs()
	arr := make([]int, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.Atoi(n)
		arr[i] = val
	}
	return arr
}

func readArrFloat() {
	numbs := readLineNumbs()
	arr := make([]float64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseFloat(n, 64)
		arr[i] = val
	}
}

func readArrInt64() []int64 {
	numbs := readLineNumbs()
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

// PRINT
func print(args ...interface{}) {
	fmt.Fprint(out, args...)
	out.Flush()
}

func println(args ...interface{}) {
	fmt.Fprintln(out, args...)
	out.Flush()
}

func printErr(args ...interface{}) {
	fmt.Fprint(err, args...)
	err.Flush()
}

func printlnErr(args ...interface{}) {
	fmt.Fprintln(err, args...)
	err.Flush()
}


package main

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

func main() {
	read := bufio.NewReader(os.Stdin)

	var t int

	fmt.Fscan(read, &t)

	for i := 0; i  < t; i++ {

		var l, r int
		fmt.Fscan(read, &l, &r)

		fmt.Println(solve(l, r))
	}
}

func solve(l, r int) int64 {

	m := l

	var left int64

	cnt := 1
	for i := 1; i < 12 ; i++ {
		if m < cnt {
			break
		}

		left += int64(m)/int64(cnt)

		cnt *= 10
	}

	m = r

	var right int64

	cnt = 1
	for i := 1; i < 12 ; i++ {
		if m < cnt {
			break
		}

		right += int64(m)/int64(cnt)

		cnt *= 10
	}

	return right - left
}
//1111111110
//1111111102

package main

import "fmt"

func main() {
	var t int
	fmt.Scanln(&t)

	var l, r int
	for ; t > 0; t-- {
		fmt.Scanln(&l, &r)
		fmt.Println(interestingFunction(l, r))
	}
}

func interestingFunction(l, r int) int {
	out := 0
	for r > 0 {
		out += r - l
		l /= 10
		r /= 10
	}
	return out
}

package main

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

var in *bufio.Reader

func count(x int64) int64 {
	result := x
	for x > 0 {
		x /= 10
		result += x
	}
	return result
}

func solve() {
	var l, r int
	fmt.Fscan(in, &l, &r)

	fmt.Println(count(int64(r)) - count(int64(l)))
}

func main() {
	in = bufio.NewReader(os.Stdin)

	var t int
	fmt.Fscan(in, &t)

	for i := 0; i < t; i++ {
		solve()
	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

func run(r io.Reader, w io.Writer) {
	in := bufio.NewReader(r)
	out := bufio.NewWriter(w)
	defer out.Flush()

	type pair struct {
		x, y int
	}
	var t int
	for Fscan(in, &t); t > 0; t-- {
		var l, r int64
		Fscan(in, &l, &r)

		right := r
		for i, j := int64(1), int64(10); r / j != 0; j *= 10 {
			right += i * (r / j) - (i-1) * (r / j)
			i++
		}
		left := l
		for i, j := int64(1), int64(10); l / j != 0; j *= 10 {
			left += i * (l / j) - (i-1) * (l / j)
			i++
		}
		Fprintln(out, right - left)
	}
}

func main() { run(os.Stdin, os.Stdout) }

func decomposition(a int) int {
	var ans int
	for p := 2; a >= p * p; {
		if a % p == 0 {
			a /= p
			ans++
		} else {
			p++
		}
	}
	if a != 1 {
		ans++
	}
	return ans
}

package main

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

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := 0
	fmt.Fscan(in, &t)
	for i := 0; i < t; i ++ {
		solve := func() {
			l, r, ans := 0, 0, 0
			fmt.Fscan(in, &l, &r)
			for ; l > 0 || r > 0; l, r = l / 10, r / 10{
				ans += r - l
			}
			fmt.Fprintln(out, ans)
		}
		solve()
	}
}

package main

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

func calculate(n int) int64 {
	ans := int64(n)
	n /= 10
	for i := n; i > 0; i /= 10 {
		ans += int64(i)
	}
	return ans
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	solve := func(Case int) {
		var l, r int
		fmt.Fscan(in, &l, &r)
		fmt.Fprintln(out, calculate(r)-calculate(l))

	}

	T := 1
	fmt.Fscan(in, &T) //
	for Case := 1; Case <= T; Case++ {
		solve(Case)
	}
}

func max(x, y int) int {
	if x < y {
		return y
	}
	return x
}

func min(a []int) int {
	mn := int(1e9)
	for i := range a {
		if a[i] < mn {
			mn = a[i]
		}
	}
	return mn
}
func gcd(x, y int) int {
	for y != 0 {
		x, y = y, x%y
	}
	return x
}

func reverse(s []byte) []byte {
	a := []byte(s)
	for i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {
		a[i], a[j] = a[j], a[i]
	}
	return a
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"io/ioutil"
	"os"
	"strings"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	f := func(n int64) (s int64) {
		t := int64(1)
		for n >= t {
			s += n / t
			t *= 10
		}
		return
	}

	solve := func(Case int) {
		var l, r int64
		Fscan(in, &l, &r)
		Fprintln(out, f(r)-f(l))
	}

	T := 1
	Fscan(in, &T) //
	for Case := 1; Case <= T; Case++ {
		solve(Case)
	}

	_leftData, _ := ioutil.ReadAll(in)
	if _s := strings.TrimSpace(string(_leftData)); _s != "" {
		panic("有未读入的数据：\n" + _s)
	}
}

func main() { run(os.Stdin, os.Stdout) }

package main

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

// Math

func main() {
	reader := bufio.NewReader(os.Stdin)

	var t int
	fmt.Fscanf(reader, "%d\n", &t)

	var l, r int
	for ; t > 0; t-- {
		fmt.Fscanf(reader, "%d%d\n", &l, &r)
		fmt.Println(interestingFunction(l, r))
	}
}

func interestingFunction(l, r int) int {
	out := 0
	for r > 0 {
		out += r - l
		l /= 10
		r /= 10
	}
	return out
}


package main

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

func min(a, b int) int {
	return int(math.Min(float64(a), float64(b)))
}

func max(a, b int) int {
	return int(math.Max(float64(a), float64(b)))
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t, now int64
	fmt.Fscanf(in, "%d\n", &t)
	for now < t {
		now++
		var n, m int
		var mat [][]int
		fmt.Fscanf(in, "%v %v\n", &n, &m)
		row := make([]int, n, n)
		col := make([]int, m, m)
		for i := 0; i < n;i++ {
			line := make([]int, m, m)
			for j := 0;j < m;j++ {
				fmt.Fscanf(in, "%v", &line[j])
				if line[j] == 1{
					row[i] = 1
					col[j] = 1
				}
			}
			fmt.Fscanf(in, "\n")
			mat = append(mat, line)
		}
		var suma, sumb = 0, 0
		for i := 0; i < n;i++ {
			if row[i] == 0 {
				suma++
			}
		}
		for i := 0; i < m;i++ {
			if col[i] == 0 {
				sumb++
			}
		}
		if min(suma, sumb) % 2 == 0 {
			fmt.Fprintln(out, "Vivek")
		} else{
			fmt.Fprintln(out, "Ashish")
		}
	}
	return
}

package main

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

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	tc := readNum(reader)

	for tc > 0 {
		tc--
		n, m := readTwoNums(reader)

		A := make([][]int, n)
		for i := 0; i < n; i++ {
			A[i] = readNNums(reader, m)
		}

		fmt.Println(solve(n, m, A))
	}
}

const Ashish = "Ashish"
const Vivek = "Vivek"

func solve(n, m int, A [][]int) string {
	row := make([]bool, n)
	col := make([]bool, m)
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			if A[i][j] == 1 {
				row[i] = true
				col[j] = true
			}
		}
	}
	var rc, cc int

	for i := 0; i < n; i++ {
		if !row[i] {
			rc++
		}
	}

	for j := 0; j < m; j++ {
		if !col[j] {
			cc++
		}
	}
	x := min(rc, cc)
	if x%2 == 1 {
		return Ashish
	}
	return Vivek
}

func min(a, b int) int {
	if a <= b {
		return a
	}
	return b
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m := 0, 0
		fmt.Fscanf(in, "%d %d\n", &n, &m)
		a := make([][]int, n)
		okn := make([]int, n)
		okm := make([]int, m)
		for i := 0; i < n; i++ {
			a[i] = make([]int, m)
			for j := 0; j < m; j++ {
				fmt.Fscanf(in, "%d", &a[i][j])
				if a[i][j] == 1 {
					okn[i] = 1
					okm[j] = 1
				}
			}
			fmt.Fscanf(in, "\n")
		}
		o, p := 0, 0
		for i := 0; i < n; i++ {
			if okn[i] == 0 {
				o++
			}
		}
		for i := 0; i < m; i++ {
			if okm[i] == 0 {
				p++
			}
		}
		if o > p {
			o = p
		}
		if o%2 == 0 {
			fmt.Fprintf(out, "Vivek\n")
		} else {
			fmt.Fprintf(out, "Ashish\n")
		}
	}
	return
}

// https://codeforces.com/contest/x/problem/A
package main

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

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)
var input io.Reader

func main() {
	var T int

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &T)
	for i := 0; i < T; i++ {
		solver()
	}
}

func solver() {
	var n, m int
	fmt.Fscan(input, &n, &m)
	ai := make([]bool, n)
	aj := make([]bool, m)
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			var tmp int
			fmt.Fscan(input, &tmp)
			if tmp == 1 {
				ai[i] = ai[i] || true
				aj[j] = aj[j] || true
			}
		}
	}
	ans := 0
	i, j := 0, 0
	for i < n && j < m {
		for i < n && ai[i] {i++; continue}
		for j < m && aj[j] {j++; continue}
		if i >= n || j >= m {break}
		ans++
		i++; j++;
	}
	if ans % 2 == 1 {
		fmt.Println("Ashish")
	} else {
		fmt.Println("Vivek")
	}
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

package main

import (
	"fmt"
)

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for k := 0; k < t; k++ {
		var n, m int
		fmt.Scanf("%d %d\n", &n, &m)
		rows := make([]int, n, n)
		cols := make([]int, m, m)
		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				var a int
				if j+1 == m {
					fmt.Scanf("%d\n", &a)
				} else {
					fmt.Scanf("%d", &a)
				}
				if a == 1 {
					rows[i] = 1
					cols[j] = 1
				}
			}
		}
		freeRows, freeCols := 0, 0
		for i := 0; i < n; i++ {
			freeRows += rows[i]
		}
		for i := 0; i < m; i++ {
			freeCols += cols[i]
		}
		freeRows = n - freeRows
		freeCols = m - freeCols

		freeCells := freeCols
		if freeRows < freeCols {
			freeCells = freeRows
		}
		if freeCells%2 == 1 {
			fmt.Println("Ashish")
		} else {
			fmt.Println("Vivek")
		}
	}

}

package main

import (
	"bufio"
	"os"
	"strconv"
	"strings"
	"fmt"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	buff := make([]byte, 16 * 1024 * 1024)

	scanner.Buffer(buff, 1024 * 1024)

	scanner.Scan()

	t := scanner.Text()

	testCases, err := strconv.Atoi(t)

	if err != nil {
		panic(err)
	}

	for j := 0; j < int(testCases); j ++ {

		scanner.Scan()

		NM := scanner.Text()

		nm := strings.Fields(NM)

		n, _ := strconv.Atoi(nm[0])
		m, _ := strconv.Atoi(nm[1])

		matrix := make([][]int, n)

		for i := 0 ; i< n; i++ {
			scanner.Scan()

			ms := scanner.Text()

			parts := strings.Fields(ms)

			matrix[i] = make([]int, m)

			for p:=0; p < m; p ++ {
				col, _ := strconv.Atoi(parts[p])

				matrix[i][p] = col

			}
		}

		ans := solve1(matrix)

		fmt.Println(ans)
	}
}

func solve1(matrix [][]int) string {
	n := len(matrix)
	m := len(matrix[0])

	sum := n * m

	rows := make([]bool, n)
	cols := make([]bool, m)

	rClaimed := 0
	cClaimed := 0

	for i := 0; i < n; i++ {
		for j := 0; j < m; j ++ {
			if matrix[i][j] == 1 {
				if !rows[i] {
					sum -= m - cClaimed
					rClaimed++
					rows[i] = true
				}
				if !cols[j] {
					sum -= n - rClaimed
					cClaimed++
					cols[j] = true
				}
			}
		}
	}

	if sum <= 0 {
		return "Vivek"
	}

	var k int
	for k = 0; ; k ++ {
		if sum <= 0 {
			break
		}
		sum -= m - cClaimed
		rClaimed++
		sum -= n - rClaimed
		cClaimed ++
	}

	if k % 2 == 0 {
		return "Vivek"
	}
	return "Ashish"
}

package main

import (
	"fmt"
)

type coord struct {
	x int
	y int
}

//refactor this using methods
func checkIfRowFree(m []int) bool {
	for i := range m {
		if m[i] == 1 {
			return false
		}
	}

	return true
}

//checkIfColfree(matrix, 3)

func checkIfColFree(m [][]int, col int) bool {
	for i := range m {
		if m[i][col] == 1 {
			return false
		}
	}

	return true
}

func main() {
	var t int
	var n, m int
	var mElem int
	var matrix [][]int
	var ashishWin bool

	// scanner := bufio.NewScanner(os.Stdin)
	// scanner.Scan()

	fmt.Scan(&t)

	for i := 0; i < t; i++ {
		ashishWin = false

		fmt.Scan(&n, &m)

		matrix = make([][]int, n)
		for j := range matrix {
			matrix[j] = make([]int, m)
		}

		for j := range matrix {
			for k := range matrix[j] {
				fmt.Scan(&mElem)
				matrix[j][k] = mElem
			}
			// fmt.Scanf("\n")
		}

		toClaim := coord{x: 0, y: 0}
		var isRowFree, isColFree bool

		// greedy algorithm
		for toClaim.x < n && toClaim.y < m {
			isRowFree = checkIfRowFree(matrix[toClaim.x])
			if !isRowFree {
				toClaim.x++
				continue
			}
			isColFree = checkIfColFree(matrix, toClaim.y)
			if !isColFree {
				toClaim.y++
				continue
			}

			matrix[toClaim.x][toClaim.y] = 1
			ashishWin = !ashishWin
			toClaim.x++
		}

		if ashishWin {
			fmt.Println("Ashish")
		} else {
			fmt.Println("Vivek")
		}
	}
}

package main

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

func main() {
	t := nextInt()
	for i := 0; i < t; i++ {
		n, m := nextInt(), nextInt()
		grid := make([][]int, n)
		for y := 0; y < n; y++ {
			grid[y] = nextInts(m)
		}
		fmt.Println(solve(grid))
	}
}

func solve(grid [][]int) string {
	Y := len(grid)
	X := len(grid[0])

	usedX := make(map[int]bool, X)
	usedY := make(map[int]bool, Y)

	for y := 0; y < Y; y++ {
		for x := 0; x < X; x++ {
			if grid[y][x] == 1 {
				usedX[x] = true
				usedY[y] = true
			}
		}
	}

	if min(X-len(usedX), Y-len(usedY))%2 == 1 {
		return "Ashish"
	} else {
		return "Vivek"
	}
}

func min(xs ...int) int {
	ret := xs[0]
	for _, x := range xs[1:] {
		if ret > x {
			ret = x
		}
	}
	return ret
}

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer(make([]byte, 256), 1e9)
	sc.Split(bufio.ScanWords)
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

/*
URL:
https://codeforces.com/contest/1365/problem/A
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	MOD          = 1000000000 + 7
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	t int

	n, m int
	A    [][]int
)

func main() {
	t = ReadInt()
	for i := 0; i < t; i++ {
		n, m = ReadInt2()
		A = [][]int{}
		for j := 0; j < n; j++ {
			row := ReadIntSlice(m)
			A = append(A, row)
		}

		solve()
	}
}

func solve() {
	r, c := n, m

	fr := 0
	for i := 0; i < n; i++ {
		if !isRowOK(i) {
			fr++
		}
	}
	fc := 0
	for j := 0; j < m; j++ {
		if !isColOK(j) {
			fc++
		}
	}
	// PrintfDebug("filled row: %d, filled column: %d\n", fr, fc)

	r -= fr
	c -= fc

	mini := Min(r, c)

	if mini%2 == 0 {
		fmt.Println("Vivek")
	} else {
		fmt.Println("Ashish")
	}
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

func isRowOK(id int) bool {
	for i := 0; i < m; i++ {
		if A[id][i] == 1 {
			return false
		}
	}
	return true
}

func isColOK(id int) bool {
	for j := 0; j < n; j++ {
		if A[j][id] == 1 {
			return false
		}
	}
	return true
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}

package main

import "fmt"

var nTest, n, m int
var a [55][55]int

func main() {
	fmt.Scan(&nTest)

	for i := 0; i < nTest; i++ {
		fmt.Scan(&n, &m)
		var row [55]bool
		var col [55]bool

		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				fmt.Scan(&a[i][j])

				if a[i][j] == 1 {
					row[i] = true
					col[j] = true
				}
			}
		}

		nRow := 0
		for i := 0; i < n; i++ {
			if row[i] {
				nRow++
			}
		}

		nCol := 0
		for i := 0; i < m; i++ {
			if col[i] {
				nCol++
			}
		}

		var step int
		if n-nRow < m-nCol {
			step = n - nRow
		} else {
			step = m - nCol
		}

		if step&1 == 1 {
			fmt.Println("Ashish")
		} else {
			fmt.Println("Vivek")
		}

	}
}

package main

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

var nTest, n, m int
var a [55][55]int

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	fmt.Fscanf(in, "%d\n", &nTest)

	for i := 0; i < nTest; i++ {
		fmt.Fscanf(in, "%d %d\n", &n, &m)
		var row [55]bool
		var col [55]bool

		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				fmt.Fscanf(in, "%d", &a[i][j])

				if a[i][j] == 1 {
					row[i] = true
					col[j] = true
				}
			}
			fmt.Fscanf(in, "\n")
		}

		nRow := 0
		for i := 0; i < n; i++ {
			if !row[i] {
				nRow++
			}
		}

		nCol := 0
		for i := 0; i < m; i++ {
			if !col[i] {
				nCol++
			}
		}

		var step int
		if nRow < nCol {
			step = nRow
		} else {
			step = nCol
		}

		if step&1 == 1 {
			fmt.Fprintf(out, "Ashish\n")
		} else {
			fmt.Fprintf(out, "Vivek\n")
		}
	}
	out.Flush()
}

package main

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

var nTest, n, m int
var a [55][55]int

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	fmt.Fscan(in, &nTest)

	for i := 0; i < nTest; i++ {
		fmt.Fscan(in, &n, &m)
		var row [55]bool
		var col [55]bool

		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				fmt.Fscan(in, &a[i][j])

				if a[i][j] == 1 {
					row[i] = true
					col[j] = true
				}
			}
			fmt.Fscanln(in)
		}

		nRow := 0
		for i := 0; i < n; i++ {
			if !row[i] {
				nRow++
			}
		}

		nCol := 0
		for i := 0; i < m; i++ {
			if !col[i] {
				nCol++
			}
		}

		var step int
		if nRow < nCol {
			step = nRow
		} else {
			step = nCol
		}

		if step&1 == 1 {
			fmt.Fprintln(out, "Ashish")
		} else {
			fmt.Fprintln(out, "Vivek")
		}
	}
	out.Flush()
}

package main

import (
	"bufio"
	"bytes"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1365A(_r io.Reader, out io.Writer) {
	in := bufio.NewReader(_r)
	var t, n, m int
	for Fscan(in, &t); t > 0; t-- {
		Fscan(in, &n, &m)
		r, c := 0, 0
		a := make([][]byte, n)
		for i := range a {
			a[i] = make([]byte, m)
			for j := range a[i] {
				Fscan(in, &a[i][j])
			}
			if !bytes.Contains(a[i], []byte{1}) {
				r++
			}
		}
	o:
		for j := 0; j < m; j++ {
			for _, r := range a {
				if r[j] == 1 {
					continue o
				}
			}
			c++
		}
		if c < r {
			r = c
		}
		if r&1 == 1 {
			Fprintln(out, "Ashish")
		} else {
			Fprintln(out, "Vivek")
		}
	}
}

func main() { CF1365A(os.Stdin, os.Stdout) }

package main
import (
        "fmt"
        "os"
        "bufio"
)
func worker(in *bufio.Reader) {
    var n, m, tmp int

    fmt.Fscan(in, &n, &m)

    rows := make([]int, n+1)
    cols := make([]int, m+1)
    for i := 1; i <= n; i++ {
        rows[i] = 1
    }
    for i := 1; i <= m; i++ {
        cols[i] = 1
    }
    for i := 1; i <= n; i++ {
        for j := 1; j <= m; j++ {
            fmt.Fscan(in, &tmp)
            if tmp == 1 {
                rows[i] = 0
                cols[j] = 0
            }
        }
    }
    rowCnt, colCnt := 0, 0
    for i := 1; i <= n; i++ {
        if rows[i] == 1 {
            rowCnt++;
        }
    }
    for i := 1; i <= m; i++ {
        if cols[i] == 1 {
            colCnt++;
        }
    }
    if rowCnt > colCnt {
        rowCnt = colCnt
    }
    if rowCnt % 2 == 0 {
        fmt.Println("Vivek")
    } else {
        fmt.Println("Ashish")
    }
}
func main(){
    var t int
    in := bufio.NewReader(os.Stdin)
    fmt.Fscan(in, &t)
    for ; t > 0; t-- {
        worker(in)
    }
}

package main

import (
	"fmt"
)

func min(a, b int) int {
	if (a < b) {
		return a
	} else {
		return b
	}
}

func main() {
	var t int
	fmt.Scan(&t)
	for tst := 0; tst < t; tst++ {
		var n int
		var m int
		fmt.Scan(&n, &m)
		ui := make(map[int]int)
		uj := make(map[int]int)
		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				var x int
				fmt.Scan(&x)
				if x == 1 {
					ui[i] = 1
					uj[j] = 1
				}
			}
		}

		cnt := min(n - len(ui), m - len(uj))
		if cnt % 2 == 0 {
			fmt.Println("Vivek")
		} else {
			fmt.Println("Ashish")
		}
	}
}

package main

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

func fastGetInt(b []byte) int {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

//========== Implement Algorithm =======================
func solution(rows int, cols int) string {
	retVal := "Vivek"
	//fmt.Println(rows, cols)
	if rows > cols {
		rows, cols = cols, rows
	}

	if rows%2 == 1 {
		retVal = "Ashish"

	}
	return retVal
}

func checkNumZero(freeCols []int) int {
	count := 0
	for x := 0; x < len(freeCols); x++ {
		if freeCols[x] == 0 {
			count++
		}
	}
	return count
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var num, x, y, freeRows, freeCols int
	var ret string
	//var freeCol []int
	//======================================================

	//============== Get return value from File ============
	if len(os.Args) >= 2 {

		file, err := os.Open(os.Args[1])
		if err != nil {
			log.Fatalf("failed opening file: %s", err)
		}
		scanner = bufio.NewScanner(file)
		defer file.Close()

	}
	scanner.Split(bufio.ScanWords)
	//======================= I/O ==========================
	scanner.Scan()
	num = fastGetInt(scanner.Bytes())
	for i := 0; i < num; i++ {
		scanner.Scan()
		x = fastGetInt(scanner.Bytes())
		scanner.Scan()
		y = fastGetInt(scanner.Bytes())
		freeCol := make([]int, y)
		freeRows = 0
		for x1 := 0; x1 < x; x1++ {
			hasFreeRow := true
			for c := 0; c < y; c++ {
				scanner.Scan()
				newNum := fastGetInt(scanner.Bytes())
				if newNum != 0 {
					hasFreeRow = false
					freeCol[c] = 1
				}
			}
			if hasFreeRow {
				freeRows++
			}
		}
		freeCols = checkNumZero(freeCol)
		ret = solution(freeRows, freeCols)
		fmt.Println(ret)
	}
	//======================================================
	//ret = solution(freeRows, freeCols)
	//==================== OUTPUT ==========================
	//fmt.Println(ret)
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	scan := func(x ...interface{}) (n int, err error) {
		return fmt.Fscan(in, x...)
	}
	println := func(x ...interface{}) (n int, err error) {
		return fmt.Fprintln(out, x...)
	}

	var t int
	for scan(&t); t > 0; t-- {
		var n, m int
		scan(&n, &m)
		isZeroCol := make([]bool, m)
		for i := range isZeroCol {
			isZeroCol[i] = true
		}
		numZeroRows := 0
		for i := 0; i < n; i++ {
			allZeros := true
			var a int8
			for j := 0; j < m; j++ {
				if scan(&a); a != 0 {
					isZeroCol[j] = false
					allZeros = false
				}
			}
			if allZeros {
				numZeroRows++
			}
		}
		numZeroColumns := 0
		for _, v := range isZeroCol {
			if v {
				numZeroColumns++
			}
		}
		var numSteps int
		if numZeroColumns < numZeroRows {
			numSteps = numZeroColumns
		} else {
			numSteps = numZeroRows
		}

		if numSteps%2 == 0 {
			println("Vivek")
		} else {
			println("Ashish")
		}
	}
}

package main

import (
	"fmt"
)
type Game struct {
	board  []bool
	Width  int
	Height int
}

func MakeGame(width, height int) Game {
	return Game{
		make([]bool, width * height),
		width,
		height,
	}
}
func (g *Game) setField(x,y int, value bool) {
	g.board[x + y * g.Width] = value
}
func (g Game) Board(x, y int) bool {
	//if x > g.Width {
	//	fmt.Printf("!!Got x: %v that is greater than width: %v\n", x, g.Width)
	//}
	return g.board[x + y * g.Width]
}

func (g Game) freeRows() (res int) {
	for x := 0; x < g.Width; x ++ {
		current := false
		for y := 0; y < g.Height; y++ {
			current = current || g.Board(x,y)
		}
		if current {
			res += 1
		}
	}
	return g.Width - res
}

func (g Game) freeCols() (res int) {
	for y := 0; y < g.Height; y++ {
		current := false
		for x := 0; x < g.Width; x ++ {
			current = current || g.Board(x,y)
		}
		if current {
			res += 1
		}
	}
	return g.Height - res
}

func (g Game) moves() int {
	cols, rows := g.freeCols(), g.freeRows()
	if cols > rows {
		return rows
	} else {
		return cols
	}
}

func scanf(format string, vars ...interface{}) {
	var err error
	_, err = fmt.Scan(vars...)
	for err != nil {
		fmt.Printf("got an error: %v", err)
		_, err = fmt.Scan(vars)
	}
}

func main() {
	var testcases int
	_, _ = fmt.Scan(&testcases)
	for i := 0; i < testcases; i++ {
		var width, height int
		scanf("%d %d", &width, &height)
		game := MakeGame(width, height)
		for j := 0; j < width; j ++ {
			for k := 0; k < height; k++ {
				var value int
				scanf("%d", &value)
				game.setField(j, k, value == 1)
			}
		}
		res := game.moves()
		if res & 1 == 0 {
			fmt.Println("Vivek")
		} else {
			fmt.Println("Ashish")
		}
	}
}

package main

import "fmt"

const maxn = int(4e5 + 5)

var (
	t, n, m int
	a       [51][51]int
)

func main() {
	fmt.Scan(&t)
	for ; t > 0; t-- {
		fmt.Scan(&n, &m)
		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				fmt.Scan(&a[i][j])
			}
		}

		row := 0
		col := 0
		for i := 0; i < n; i++ {
			ok := true
			for j := 0; j < m; j++ {
				if a[i][j] == 1 {
					ok = false
					break
				}
			}

			if ok {
				row++
			}
		}

		for j := 0; j < m; j++ {
			ok := true
			for i := 0; i < n; i++ {
				if a[i][j] == 1 {
					ok = false
					break
				}
			}

			if ok {
				col++
			}
		}

		if col < row {
			row = col
		}

		if row&1 == 1 {
			fmt.Println("Ashish")
		} else {
			fmt.Println("Vivek")
		}
	}
}

// Author: sighduck
// URL: https://codeforces.com/contest/1365/problem/A

package main

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

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func Solve(n int, m int, matrix [][]int) string {
	rows := make([]bool, n)
	columns := make([]bool, m)
	for i := 0; i < n; i++ {
		rows[i] = true
	}
	for i := 0; i < m; i++ {
		columns[i] = true
	}
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			if matrix[i][j] == 1 {
				rows[i] = false
				columns[j] = false
			}
		}
	}
	rowCount := 0
	columnCount := 0
	for _, elem := range rows {
		if elem {
			rowCount += 1
		}
	}
	for _, elem := range columns {
		if elem {
			columnCount += 1
		}
	}
	if min(rowCount, columnCount)%2 == 1 {
		return "Ashish"
	}
	return "Vivek"
}

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

	var t int
	fmt.Fscanf(reader, "%d\n", &t)
	for i := 0; i < t; i++ {
		var n, m int
		fmt.Fscanf(reader, "%d %d\n", &n, &m)
		matrix := make([][]int, n)
		for i := 0; i < n; i++ {
			matrix[i] = make([]int, m)
			for j := 0; j < m; j++ {
				fmt.Fscanf(reader, "%d ", &matrix[i][j])
			}
			fmt.Fscanf(reader, "\n")
		}
		fmt.Fprintf(writer, "%s\n", Solve(n, m, matrix))
	}
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
)

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	Int64() int64
	UInt64() uint64
	String() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) Int64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) UInt64() uint64 {
	impl.Scan()
	bb := impl.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) String() string {
	impl.Scan()
	return impl.Text()
}

func gcd(a, b int64) int64 {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

func lcm(a, b int64) int64 {
	return a * b / gcd(a, b)
}

func abs(a int64) int64 {
	if a < 0 {
		return a * -1
	}
	return a
}

func min(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r < a {
			a = r
		}
	}
	return a
}

func max(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r > a {
			a = r
		}
	}
	return a
}

const (
	INF = int64(math.MaxInt64)
	MOD = 1e9 + 7
)

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.Int64()
	for ; t > 0; t-- {
		n := reader.Int64()
		m := reader.Int64()
		mat := make([][]int64, n)
		for i := range mat {
			mat[i] = make([]int64, m)
			for j := range mat[i] {
				mat[i][j] = reader.Int64()
			}
		}
		writer.Printf("%s\n", sol(mat))
	}
}

func sol(mat [][]int64) string {
	for i := range mat {
		for j := range mat[i] {
			if mat[i][j] == 1 {
				for x := range mat[i] {
					if mat[i][x] == 0 {
						mat[i][x] = 2
					}
				}
				for x := range mat {
					if mat[x][j] == 0 {
						mat[x][j] = 2
					}
				}
				mat[i][j] = 2
			}
		}
	}
	//writer.Printf("%+v\n", mat)

	total := 0
	for i := range mat {
		for j := range mat[i] {
			if mat[i][j] == 0 {
				total++
				for x := range mat[i] {
					mat[i][x] = 2
				}
				for x := range mat {
					mat[x][j] = 2
				}
			}
		}
	}
	if total & 1 == 1 {
		return "Ashish"
	}
	return "Vivek"
}

package main

import (
	"bufio"
	"os"
	"strconv"
	"strings"
	"fmt"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	buff := make([]byte, 2 * 1024 * 1024)

	scanner.Buffer(buff, 1024 * 1024)

	scanner.Scan()

	t := scanner.Text()

	testCases, err := strconv.Atoi(t)

	if err != nil {
		panic(err)
	}

	for j := 0; j < int(testCases); j ++ {

		scanner.Scan()

		NM := scanner.Text()

		nm := strings.Fields(NM)

		n, _ := strconv.Atoi(nm[0])
		m, _ := strconv.Atoi(nm[1])

		matrix := make([][]int, n)

		for i := 0 ; i< n; i++ {
			scanner.Scan()

			ms := scanner.Text()

			parts := strings.Fields(ms)

			matrix[i] = make([]int, m)

			for p:=0; p < m; p ++ {
				col, _ := strconv.Atoi(parts[p])

				matrix[i][p] = col

			}
		}

		ans := solve1(matrix)

		fmt.Println(ans)
	}
}

func solve1(matrix [][]int) string {
	n := len(matrix)
	m := len(matrix[0])

	sum := n * m

	rows := make([]bool, n)
	cols := make([]bool, m)

	rClaimed := 0
	cClaimed := 0

	for i := 0; i < n; i++ {
		for j := 0; j < m; j ++ {
			if matrix[i][j] == 1 {
				if !rows[i] {
					sum -= n - cClaimed
					rClaimed++
					rows[i] = true
				}
				if !cols[j] {
					sum -= m - rClaimed
					cClaimed++
					cols[j] = true
				}

			}
		}
	}

	if sum <= 0 {
		return "Vivek"
	}

	var k int
	for k = 0; ; k ++ {
		if sum <= 0 {
			break
		}
		sum -= n - cClaimed
		rClaimed++
		sum -= m - rClaimed
		cClaimed ++
	}

	if k % 2 == 0 {
		return "Vivek"
	}
	return "Ashish"
}

// 1 0 0
// 0 0 0
// 1 0 0

package main

import (
	"fmt"
)

type coord struct {
	x int
	y int
}

//refactor this using methods
func checkIfRowFree(m []int) bool {
	for i := range m {
		if m[i] == 1 {
			return false
		}
	}

	return true
}

//checkIfColfree(matrix, 3)

func checkIfColFree(m [][]int, col int) bool {
	for i := range m {
		if m[i][col] == 1 {
			return false
		}
	}

	return true
}

func main() {
	var t int
	var n, m int
	var mElem int
	var matrix [][]int

	fmt.Scanf("%d\n", &t)

	for i := 0; i < t; i++ {
		fmt.Scanf("%d %d\n", &n, &m)

		matrix = make([][]int, n)
		for j := range matrix {
			matrix[j] = make([]int, m)
		}

		for j := range matrix {
			for k := range matrix[j] {
				fmt.Scanf("%d", &mElem)
				matrix[j][k] = mElem
			}
		}

		var ashishWin bool = false
		toClaim := coord{x: 0, y: 0}
		var isRowFree, isColFree bool

		// greedy algorithm
		for toClaim.x < n && toClaim.y < m {
			isRowFree = checkIfRowFree(matrix[toClaim.x])
			if !isRowFree {
				toClaim.x++
				continue
			}
			isColFree = checkIfColFree(matrix, toClaim.y)
			if !isColFree {
				toClaim.y++
				continue
			}

			matrix[toClaim.x][toClaim.y] = 1
			ashishWin = !ashishWin
			toClaim.x++
		}

		if ashishWin {
			fmt.Println("Ashish")
		} else {
			fmt.Println("Vivek")
		}
	}
}

package main

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

func main() {
	t := nextInt()
	for i := 0; i < t; i++ {
		n, m := nextInt(), nextInt()
		grid := make([][]int, n)
		for y := 0; y < n; y++ {
			grid[y] = nextInts(m)
		}
		fmt.Println(solve(grid))
	}
}

func solve(grid [][]int) string {
	Y := len(grid)
	X := len(grid[0])

	usedX := make(map[int]bool, X)
	usedY := make(map[int]bool, Y)

	for y := 0; y < Y; y++ {
		for x := 0; x < X; x++ {
			if grid[y][x] == 1 {
				usedX[x] = true
				usedY[y] = true
			}
		}
	}

	if min(len(usedX), len(usedY))%2 == 1 {
		return "Ashish"
	} else {
		return "Vivek"
	}
}

func min(xs ...int) int {
	ret := xs[0]
	for _, x := range xs[1:] {
		if ret > x {
			ret = x
		}
	}
	return ret
}

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer(make([]byte, 256), 1e9)
	sc.Split(bufio.ScanWords)
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

package main

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

func main() {
	t := nextInt()
	for i := 0; i < t; i++ {
		n, m := nextInt(), nextInt()
		grid := make([][]int, n)
		for y := 0; y < n; y++ {
			grid[y] = nextInts(m)
		}
		fmt.Println(solve(grid))
	}
}

func solve(grid [][]int) string {
	Y := len(grid)
	X := len(grid[0])

	usedX := make(map[int]bool, X)
	usedY := make(map[int]bool, Y)

	for y := 0; y < Y; y++ {
		for x := 0; x < X; x++ {
			if grid[y][x] == 1 {
				usedX[x] = true
				usedY[y] = true
			}
		}
	}

	turn := 0
	for {
		if len(usedX) == X || len(usedY) == Y {
			if turn%2 == 0 {
				return "Vivek"
			} else {
				return "Ashish"
			}
		}
		for x := 0; x < X; x++ {
			if usedX[x] {
				continue
			}
			usedX[x] = true
			break
		}
		for y := 0; y < X; y++ {
			if usedY[y] {
				continue
			}
			usedY[y] = true
			break
		}
		turn++
	}
}

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer(make([]byte, 256), 1e9)
	sc.Split(bufio.ScanWords)
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

package main

import "fmt"

var nTest, n, m int
var a [55][55]int

func fill(x, y int) {
	dx := []int{0, 0, 1, -1}
	dy := []int{1, -1, 0, 0}

	for i := 0; i < 4; i++ {
		if x+dx[i] < n && x+dx[i] >= 0 && y+dy[i] < m && y+dy[i] >= 0 {
			a[x+dx[i]][y+dy[i]] = -1
		}
	}
}

func move() (int, int) {
	bestCnt := 0
	bestx := -1
	besty := -1
	dx := []int{0, 0, 1, -1}
	dy := []int{1, -1, 0, 0}

	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			if a[i][j] != 0 {
				continue
			}
			cnt := 0
			for k := 0; k < 4; k++ {
				nx := i + dx[k]
				ny := j + dy[k]

				if nx < n && nx >= 0 && ny < m && ny >= 0 && a[nx][ny] == 0 {
					cnt++
				}
			}

			if cnt > bestCnt {
				bestCnt = cnt
				bestx = i
				besty = j
			}
		}
	}

	return bestx, besty
}

func main() {
	fmt.Scan(&nTest)

	for i := 0; i < nTest; i++ {
		fmt.Scan(&n, &m)

		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				fmt.Scan(&a[i][j])
			}
		}

		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				if a[i][j] == 1 {
					fill(i, j)
				}
			}
		}

		step := 0
		moveX, moveY := move()
		for moveX != -1 {
			step++
			a[moveX][moveY] = 1
			fill(moveX, moveY)
			moveX, moveY = move()
		}

		if step&1 == 1 {
			fmt.Println("Ashish")
		} else {
			fmt.Println("Vivek")
		}

	}
}

package main

import "fmt"

var nTest, n, m int
var a [55][55]int

func fill(x, y int) {
	dx := []int{0, 0, 1, -1}
	dy := []int{1, -1, 0, 0}

	for i := 0; i < 4; i++ {
		nx := x + dx[i]
		ny := y + dy[i]
		if nx >= 0 && nx < n && ny >= 0 && ny < n && a[nx][ny] == 0 {
			a[nx][ny] = -1
		}
	}
}

func move() (int, int) {
	bestCnt := -1
	bestx := -1
	besty := -1
	dx := []int{0, 0, 1, -1}
	dy := []int{1, -1, 0, 0}

	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			if a[i][j] != 0 {
				continue
			}

			cnt := 0
			cannot := false
			for k := 0; k < 4; k++ {
				nx := i + dx[k]
				ny := j + dy[k]
				if nx < n && nx >= 0 && ny < m && ny >= 0 && a[nx][ny] == 1 {
					cannot = true
					break
				}

				if nx < n && nx >= 0 && ny < m && ny >= 0 && a[nx][ny] == 0 {
					cnt++
				}
			}

			if cannot {
				continue
			}

			if cnt > bestCnt {
				bestCnt = cnt
				bestx = i
				besty = j
			}
		}
	}

	return bestx, besty
}

func main() {
	fmt.Scan(&nTest)

	for i := 0; i < nTest; i++ {
		fmt.Scan(&n, &m)

		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				fmt.Scan(&a[i][j])
			}
		}

		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				if a[i][j] == 1 {
					fill(i, j)
				}
			}
		}

		step := 0
		moveX, moveY := move()

		// fmt.Print(moveX, moveY)
		for moveX != -1 {
			step++
			a[moveX][moveY] = 1
			fill(moveX, moveY)
			moveX, moveY = move()
		}

		if step&1 == 1 {
			fmt.Println("Ashish")
		} else {
			fmt.Println("Vivek")
		}

	}
}

package main

import "fmt"

var nTest, n, m int
var a [55][55]int

func fill(x, y int) {
	dx := []int{0, 0, 1, -1}
	dy := []int{1, -1, 0, 0}

	for i := 0; i < 4; i++ {
		if x+dx[i] < n && x+dx[i] >= 0 && y+dy[i] < m && y+dy[i] >= 0 {
			a[x+dx[i]][y+dy[i]] = -1
		}
	}
}

func move() (int, int) {
	bestCnt := 0
	bestx := -1
	besty := -1
	dx := []int{0, 0, 1, -1}
	dy := []int{1, -1, 0, 0}

	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			cnt := 0
			for k := 0; k < 4; k++ {
				nx := i + dx[k]
				ny := j + dy[k]

				if nx < n && nx >= 0 && ny < m && ny >= 0 && a[nx][ny] == 0 {
					cnt++
				}
			}

			if cnt > bestCnt {
				bestCnt = cnt
				bestx = i
				besty = j
			}
		}
	}

	return bestx, besty
}

func main() {
	fmt.Scan(&nTest)

	for i := 0; i < nTest; i++ {
		fmt.Scan(&n, &m)

		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				fmt.Scan(&a[i][j])
			}
		}

		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				if a[i][j] == 1 {
					fill(i, j)
				}
			}
		}

		step := 0
		moveX, moveY := move()
		for moveX != -1 {
			step++
			a[moveX][moveY] = 1
			fill(moveX, moveY)
			moveX, moveY = move()
		}

		if step&1 == 1 {
			fmt.Println("Ashish")
		} else {
			fmt.Println("Vivek")
		}

	}
}

package main

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

func min(a, b int) int {
	return int(math.Min(float64(a), float64(b)))
}

func max(a, b int) int {
	return int(math.Max(float64(a), float64(b)))
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t, now int64
	fmt.Fscanf(in, "%d\n", &t)
	for now < t {
		now++
		var n, m int
		var mat [][]int
		fmt.Fscanf(in, "%v %v\n", &n, &m)
		row := make([]int, n, n)
		col := make([]int, m, m)
		for i := 0; i < n;i++ {
			line := make([]int, m, m)
			for j := 0;j < m;j++ {
				fmt.Fscanf(in, "%v", &line[j])
				if line[j] == 1{
					row[i] = 1
					col[j] = 1
				}
			}
			fmt.Fscanf(in, "\n")
			mat = append(mat, line)
		}
		var sum = 0
		for i := 0; i < min(m, n);i++ {
			if row[i] == 0 && col[i] == 0{
				sum++
			}
		}
		if n > m {
			for i := min(n, m);i < max(n, m);i++{
				if row[i] == 0 {
					sum++
				}
			}
		} else{
			for i := min(n, m);i < max(n, m);i++{
				if col[i] == 0 {
					sum++
				}
			}
		}
		if sum % 2 == 0 {
			fmt.Fprintln(out, "Vivek")
		} else{
			fmt.Fprintln(out, "Ashish")
		}
	}
	return
}

package main

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

func min(a, b int) int {
	return int(math.Min(float64(a), float64(b)))
}

func max(a, b int) int {
	return int(math.Max(float64(a), float64(b)))
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t, now int64
	fmt.Fscanf(in, "%d\n", &t)
	for now < t {
		now++
		var n, m int
		var mat [][]int
		fmt.Fscanf(in, "%v %v\n", &n, &m)
		row := make([]int, n, n)
		col := make([]int, m, m)
		for i := 0; i < n;i++ {
			line := make([]int, m, m)
			for j := 0;j < m;j++ {
				fmt.Fscanf(in, "%v", &line[j])
				if line[j] == 1{
					row[i] = 1
					col[j] = 1
				}
			}
			fmt.Fscanf(in, "\n")
			mat = append(mat, line)
		}
		var sum = 0
		for i := 0; i < min(m, n);i++ {
			if row[i] == 0 && col[i] == 0{
				sum++
			}
		}
		if sum % 2 == 0 {
			fmt.Fprintln(out, "Vivek")
		} else{
			fmt.Fprintln(out, "Ashish")
		}
	}
	return
}

package main

import (
	"fmt"
)

func min(a, b int) int {
	if (a < b) {
		return a
	} else {
		return b
	}
}

func main() {
	var t int
	fmt.Scan(&t)
	for tst := 0; tst < t; tst++ {
		var n int
		var m int
		fmt.Scan(&n, &m)
		ui := make(map[int]int)
		uj := make(map[int]int)
		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				var x int
				fmt.Scan(&x)
				if x == 1 {
					ui[i] = 1
					uj[j] = 1
				}
			}
		}

		cnt := min(n - len(ui), m - len(uj))
		if cnt % 2 == 1 {
			fmt.Println("Vivek")
		} else {
			fmt.Println("Ashish")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var t int
	fmt.Scanf("%d", &t)
	for tst := 0; tst < t; tst++ {
		var n int
		var m int

		fmt.Scanf("%d %d", &n, &m)
		cnt := 0
		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				var x int
				fmt.Scanf("%d", &x)
				if x == 1 {
					cnt++
				}
			}
		}

		if cnt == 0 || (n * m - cnt) % 2 == 0 {
			fmt.Println("Vivek")
		} else {
			fmt.Println("Ashish")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var t int
	fmt.Scan(&t)
	for tst := 0; tst < t; tst++ {
		var n int
		var m int

		fmt.Scan(&n, &m)
		cnt := 0
		for i := 0; i < n; i++ {
			for j := 0; j < m; j++ {
				var x int
				fmt.Scan(&x)
				if x == 1 {
					cnt++
				}
			}
		}

		if cnt == 0 || (n * m - cnt) % 2 == 0 {
			fmt.Println("Vivek")
		} else {
			fmt.Println("Ashish")
		}
	}
}

package main

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

func fastGetInt(b []byte) int {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

//========== Implement Algorithm =======================
func solution(rows int, cols int) string {
	retVal := "Vivek"
	if rows > cols {
		rows, cols = cols, rows
	}

	if rows%2 == 1 {
		retVal = "Ashish"
	}
	return retVal
}

func checkNumNonZero(freeCols []int) int {
	count := 0
	for x := 0; x < len(freeCols); x++ {
		if freeCols[x] != 0 {
			count++
		}
	}
	return count
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var num, x, y, freeRows, freeCols int
	var ret string
	//var freeCol []int
	//======================================================

	//============== Get return value from File ============
	if len(os.Args) >= 2 {

		file, err := os.Open(os.Args[1])
		if err != nil {
			log.Fatalf("failed opening file: %s", err)
		}
		scanner = bufio.NewScanner(file)
		defer file.Close()

	}
	scanner.Split(bufio.ScanWords)
	//======================= I/O ==========================
	scanner.Scan()
	num = fastGetInt(scanner.Bytes())
	for i := 0; i < num; i++ {
		scanner.Scan()
		x = fastGetInt(scanner.Bytes())
		scanner.Scan()
		y = fastGetInt(scanner.Bytes())
		freeCol := make([]int, y)
		freeRows = 0
		for x1 := 0; x1 < x; x1++ {
			hasFreeRow := true
			for c := 0; c < y; c++ {
				scanner.Scan()
				newNum := fastGetInt(scanner.Bytes())
				if newNum != 0 {
					hasFreeRow = false
					freeCol[c] = 1
				}
			}
			if hasFreeRow {
				freeRows++
			}
		}
		freeCols = checkNumNonZero(freeCol)
		ret = solution(freeRows, freeCols)
		fmt.Println(ret)
	}
	//======================================================
	//ret = solution(freeRows, freeCols)
	//==================== OUTPUT ==========================
	//fmt.Println(ret)
}

package main

import (
	"fmt"
)
type Game struct {
	board  []bool
	Width  int
	Height int
}

func MakeGame(width, height int) Game {
	return Game{
		make([]bool, width * height),
		width,
		height,
	}
}
func (g *Game) setField(x,y int, value bool) {
	g.board[x + y * g.Width] = value
}
func (g Game) Board(x, y int) bool {
	//if x > g.Width {
	//	fmt.Printf("!!Got x: %v that is greater than width: %v\n", x, g.Width)
	//}
	return g.board[x + y * g.Width]
}

func (g Game) freeRows() (res int) {
	for x := 0; x < g.Width; x ++ {
		current := false
		for y := 0; y < g.Height; y++ {
			current = current || g.Board(x,y)
		}
		fmt.Println()
		if current {
			res += 1
		}
	}
	return g.Width - res
}

func (g Game) freeCols() (res int) {
	for y := 0; y < g.Height; y++ {
		current := false
		for x := 0; x < g.Width; x ++ {
			current = current || g.Board(x,y)
		}
		if current {
			res += 1
		}
	}
	return g.Height - res
}

func (g Game) moves() int {
	cols, rows := g.freeCols(), g.freeRows()
	if cols > rows {
		return rows
	} else {
		return cols
	}
}

func main() {
	testcases := 0
	_, _ = fmt.Scanf("%d", &testcases)
	for i := 0; i < testcases; i++ {
		var width, height int
		if _, err := fmt.Scanf("%d %d", &width, &height); err != nil {
			testcases --
			continue
		}
		game := MakeGame(width, height)
		for j := 0; j < width; j ++ {
			for k := 0; k < height; k++ {
				var value int
				fmt.Scanf("%d", &value)
				game.setField(j, k, value == 1)
			}
		}
		res := game.moves()
		fmt.Printf("moves %v\n", res)
		if res & 1 == 0 {
			fmt.Println("Vivek")
		} else {
			fmt.Println("Ashish")
		}
	}
}

package main

import (
	"fmt"
)
type Game struct {
	board  []bool
	Width  int
	Height int
}

func MakeGame(width, height int) Game {
	return Game{
		make([]bool, width * height),
		width,
		height,
	}
}
func (g *Game) setField(x,y int, value bool) {
	g.board[x + y * g.Width] = value
}
func (g Game) Board(x, y int) bool {
	//if x > g.Width {
	//	fmt.Printf("!!Got x: %v that is greater than width: %v\n", x, g.Width)
	//}
	return g.board[x + y * g.Width]
}

func (g Game) freeRows() (res int) {
	for x := 0; x < g.Width; x ++ {
		current := false
		for y := 0; y < g.Height; y++ {
			current = current || g.Board(x,y)
		}
		if current {
			res += 1
		}
	}
	return g.Width - res
}

func (g Game) freeCols() (res int) {
	for y := 0; y < g.Height; y++ {
		current := false
		for x := 0; x < g.Width; x ++ {
			current = current || g.Board(x,y)
		}
		if current {
			res += 1
		}
	}
	return g.Height - res
}

func (g Game) moves() int {
	cols, rows := g.freeCols(), g.freeRows()
	if cols > rows {
		return rows
	} else {
		return cols
	}
}

func scanf(format string, vars ...interface{}) {
	var err error
	_, err = fmt.Scan(vars...)
	for err != nil {
		fmt.Printf("got an error: %v", err)
		_, err = fmt.Scan(vars)
	}
}

func main() {
	testcases := 0
	_, _ = fmt.Scan("%d", &testcases)
	for i := 0; i < testcases; i++ {
		var width, height int
		scanf("%d %d", &width, &height)
		game := MakeGame(width, height)
		for j := 0; j < width; j ++ {
			for k := 0; k < height; k++ {
				var value int
				scanf("%d", &value)
				game.setField(j, k, value == 1)
			}
		}
		res := game.moves()
		if res & 1 == 0 {
			fmt.Println("Vivek")
		} else {
			fmt.Println("Ashish")
		}
	}
}

package main

import (
	"fmt"
)
type Game struct {
	board  []bool
	Width  int
	Height int
}

func MakeGame(width, height int) Game {
	return Game{
		make([]bool, width * height),
		width,
		height,
	}
}
func (g *Game) setField(x,y int, value bool) {
	g.board[x + y * g.Width] = value
}
func (g Game) Board(x, y int) bool {
	//if x > g.Width {
	//	fmt.Printf("!!Got x: %v that is greater than width: %v\n", x, g.Width)
	//}
	return g.board[x + y * g.Width]
}

func (g Game) freeRows() (res int) {
	for x := 0; x < g.Width; x ++ {
		current := false
		for y := 0; y < g.Height; y++ {
			current = current || g.Board(x,y)
		}
		if current {
			res += 1
		}
	}
	return g.Width - res
}

func (g Game) freeCols() (res int) {
	for y := 0; y < g.Height; y++ {
		current := false
		for x := 0; x < g.Width; x ++ {
			current = current || g.Board(x,y)
		}
		if current {
			res += 1
		}
	}
	return g.Height - res
}

func (g Game) moves() int {
	cols, rows := g.freeCols(), g.freeRows()
	if cols > rows {
		return rows
	} else {
		return cols
	}
}

func main() {
	testcases := 0
	_, _ = fmt.Scanf("%d", &testcases)
	for i := 0; i < testcases; i++ {
		var width, height int
		if _, err := fmt.Scanf("%d %d", &width, &height); err != nil {
			testcases --
			continue
		}
		game := MakeGame(width, height)
		for j := 0; j < width; j ++ {
			for k := 0; k < height; k++ {
				var value int
				if _, err := fmt.Scanf("%d", &value); err != nil {
					k--
					continue
				}
				game.setField(j, k, value == 1)
			}
		}
		res := game.moves()
		if res & 1 == 0 {
			fmt.Println("Vivek")
		} else {
			fmt.Println("Ashish")
		}
	}
}

package main

import (
	"fmt"
)
type Game struct {
	board  []bool
	Width  int
	Height int
}

func MakeGame(width, height int) Game {
	return Game{
		make([]bool, width * height),
		width,
		height,
	}
}
func (g *Game) setField(x,y int, value bool) {
	g.board[x + y * g.Width] = value
}
func (g Game) Board(x, y int) bool {
	if x > g.Width {
		fmt.Printf("!!Got x: %v that is greater than width: %v\n", x, g.Width)
	}
	return g.board[x + y * g.Width]
}

func (g Game) freeRows() (res int) {
	for x := 0; x < g.Width; x ++ {
		current := false
		for y := 0; y < g.Height; y++ {
			fmt.Printf("%v ", g.Board(x,y))
			current = current || g.Board(x,y)
		}
		fmt.Println()
		if current {
			res += 1
		}
	}
	return g.Width - res
}

func (g Game) freeCols() (res int) {
	for y := 0; y < g.Height; y++ {
		current := false
		for x := 0; x < g.Width; x ++ {
			current = current || g.Board(x,y)
		}
		if current {
			res += 1
		}
	}
	return g.Height - res
}

func (g Game) moves() int {
	cols, rows := g.freeCols(), g.freeRows()
	fmt.Printf("\n got %v %v\n", cols, rows)
	if cols > rows {
		return rows
	} else {
		return cols
	}
}

func main() {
	testcases := 0
	_, _ = fmt.Scanf("%d", &testcases)
	for i := 0; i < testcases; i++ {
		var width, height int
		if _, err := fmt.Scanf("%d %d", &width, &height); err != nil {
			testcases --
			continue
		}
		game := MakeGame(width, height)
		for j := 0; j < width; j ++ {
			for k := 0; k < height; k++ {
				var value int
				fmt.Scanf("%d", &value)
				game.setField(j, k, value == 1)
			}
		}
		res := game.moves()
		fmt.Printf("moves %v\n", res)
		if res & 1 == 0 {
			fmt.Println("Vivek")
		} else {
			fmt.Println("Ashish")
		}
	}
}

package main

import (
	"fmt"
)
type Game struct {
	board  []bool
	Width  int
	Height int
}

func MakeGame(width, height int) Game {
	return Game{
		make([]bool, width * height),
		width,
		height,
	}
}
func (g *Game) setField(x,y int, value bool) {
	g.board[x + y * g.Width] = value
}
func (g Game) Board(x, y int) bool {
	//if x > g.Width {
	//	fmt.Printf("!!Got x: %v that is greater than width: %v\n", x, g.Width)
	//}
	return g.board[x + y * g.Width]
}

func (g Game) freeRows() (res int) {
	for x := 0; x < g.Width; x ++ {
		current := false
		for y := 0; y < g.Height; y++ {
			current = current || g.Board(x,y)
		}
		if current {
			res += 1
		}
	}
	return g.Width - res
}

func (g Game) freeCols() (res int) {
	for y := 0; y < g.Height; y++ {
		current := false
		for x := 0; x < g.Width; x ++ {
			current = current || g.Board(x,y)
		}
		if current {
			res += 1
		}
	}
	return g.Height - res
}

func (g Game) moves() int {
	cols, rows := g.freeCols(), g.freeRows()
	if cols > rows {
		return rows
	} else {
		return cols
	}
}

func main() {
	testcases := 0
	_, _ = fmt.Scanf("%d", &testcases)
	for i := 0; i < testcases; i++ {
		var width, height int
		if _, err := fmt.Scanf("%d %d", &width, &height); err != nil {
			testcases --
			continue
		}
		game := MakeGame(width, height)
		for j := 0; j < width; j ++ {
			for k := 0; k < height; k++ {
				var value int
				fmt.Scanf("%d", &value)
				game.setField(j, k, value == 1)
			}
		}
		res := game.moves()
		if res & 1 == 0 {
			fmt.Println("Vivek")
		} else {
			fmt.Println("Ashish")
		}
	}
}

package main

import (
	"fmt"
)
type Game struct {
	board  []bool
	Width  int
	Height int
}

func MakeGame(width, height int) Game {
	return Game{
		make([]bool, width * height),
		width,
		height,
	}
}
func (g *Game) setField(x,y int, value bool) {
	g.board[x + y * g.Width] = value
}
func (g Game) Board(x, y int) bool {
	if x > g.Width {
		fmt.Printf("!!Got x: %v that is greater than width: %v\n", x, g.Width)
	}
	return g.board[x + y * g.Width]
}

func (g Game) freeRows() (res int) {
	for x := 0; x < g.Width; x ++ {
		current := false
		for y := 0; y < g.Height; y++ {
			current = current || g.Board(x,y)
		}
		if current {
			res += 1
		}
	}
	return g.Width - res
}

func (g Game) freeCols() (res int) {
	for y := 0; y < g.Height; y++ {
		current := false
		for x := 0; x < g.Width; x ++ {
			current = current || g.Board(x,y)
		}
		if current {
			res += 1
		}
	}
	return g.Height - res
}

func (g Game) moves() int {
	cols, rows := g.freeCols(), g.freeRows()
	if cols > rows {
		return rows
	} else {
		return cols
	}
}

func main() {
	testcases := 0
	fmt.Scanf("%d", &testcases)
	for i := 0; i < testcases; i++ {
		var width, height int
		fmt.Scanf("%d %d", &width, &height)
		game := MakeGame(width, height)
		for j := 0; j < width; j ++ {
			for k := 0; k < height; k++ {
				var value int
				fmt.Scanf("%d", &value)
				game.setField(j, k, value == 1)
			}
		}
		res := game.moves()
		if res & 1 == 0 {
			fmt.Println("Vivek")
		} else {
			fmt.Println("Ashish")
		}
	}
}