Eudokimus, a system administrator is in trouble again. As a result of an error in some script, a list of names of very important files has been damaged. Since they were files in the BerFS file system, it is known that each file name has a form "name.ext", where:   name is a string consisting of lowercase Latin letters, its length is from 1 to 8 characters;  ext is a string consisting of lowercase Latin letters, its length is from 1 to 3 characters. For example, "read.me", "example.txt" and "b.cpp" are valid file names and "version.info", "ntldr" and "contestdata.zip" are not.Damage to the list meant that all the file names were recorded one after another, without any separators. So now Eudokimus has a single string.Eudokimus needs to set everything right as soon as possible. He should divide the resulting string into parts so that each part would be a valid file name in BerFS. Since Eudokimus has already proved that he is not good at programming, help him. The resulting file list can contain the same file names.

The input data consists of a single string s, its length is from 1 to 4·105 characters. The string can contain only lowercase Latin letters ('a' - 'z') and periods ('.').

In the first line print "YES" (without the quotes), if it is possible to divide s into parts as required. In this case, the following lines should contain the parts of the required partition, one per line in the order in which they appear in s. The required partition can contain the same file names. If there are multiple solutions, print any of them. If the solution does not exist, then print in a single line "NO" (without the quotes).

package main

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

func main()  {
	var str string
	scanner := bufio.NewScanner(os.Stdin)
	//adjust the capacity to your need (max characters in line)
	const maxCapacity = 512*1024
	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)
	scanner.Split(bufio.ScanLines)
	scanner.Scan()
	str = scanner.Text()
	var i int = 0
	for ; i < len(str); i++{
		if str[i] == '.'{break}
	}
	if i > 8 || i==0 {
		fmt.Printf("NO")

	}else{
		prev := i + 1
		i++
		for ; i < len(str); i++{
			if str[i] == '.'{
				if i - prev > 11 || i - prev < 2{
					break
				}else{
					prev = i + 1
				}
			}
		}
		if i != len(str){
			fmt.Printf("NO")

		}else if i - prev > 3 || i == prev {
			fmt.Printf("NO")

		}else {
			fmt.Println("YES")
			strs := strings.Split(str,".")
			prev := 0
			for i=0; i< len(strs)-2; i++{
				fmt.Printf("%s.",strs[i][prev:])
				if len(strs[i+1]) < 4 {//xxx.a xxx
					prev = 1
				}else{ //xxx.aaa xxx
					prev = 3
				}
				fmt.Printf("%s\n",strs[i+1][:prev])
			}
			fmt.Printf("%s.%s\n",strs[i][prev:],strs[i+1])
		}
	}

}

package main

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

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

  line, _ := reader.ReadString('\n')
  line = strings.TrimSpace(line)
  parts := strings.Split(line, ".")
  n := len(parts)
  if n < 2 {
    writer.WriteString("NO\n")
    return
  }
  result := make([]string, n - 1)

  for i := range result {
    s, t := parts[i], parts[i + 1]
    a, b := len(s), len(t)
    if a < 1 || a > 8 || b == 0 {
      writer.WriteString("NO\n")
      return
    }
    c := b - 1
    if c < 1 {
      c = 1
    } else if c > 3 {
      c = 3
    }
    t, parts[i + 1] = t[:c], t[c:]
    result[i] = s + "." + t
  }
  result[n - 2] += parts[n - 1]
  if strings.Index(result[n - 2], ".") < len(result[n - 2]) - 4 {
    writer.WriteString("NO\n")
    return
  }

  writer.WriteString("YES\n")
  for _, name := range result {
    writer.WriteString(fmt.Sprintf("%s\n", name))
  }
}

package main

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

func main()  {
	var str string
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanLines)
	scanner.Scan()
	str = scanner.Text()
	var i int = 0
	for ; i < len(str); i++{
		if str[i] == '.'{break}
	}
	if i > 8 || i==0 {
		fmt.Printf("NO")
	}else{
		prev := i + 1
		i++
		for ; i < len(str); i++{
			if str[i] == '.'{
				if i - prev > 11 || i - prev < 2{
					break
				}else{
					prev = i + 1
				}
			}
		}
		if i != len(str){
			fmt.Printf("NO")
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Printf("len %v, str %s",i,str[i-20:i])
			}
		}else if i - prev > 3 || i == prev {
			fmt.Printf("NO")
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Printf("len %v, str %s",i,str[i-20:i])
			}
		}else {
			fmt.Println("YES")
			strs := strings.Split(str,".")
			prev := 0
			for i=0; i< len(strs)-2; i++{
				fmt.Printf("%s.",strs[i][prev:])
				if len(strs[i+1]) < 4 {//xxx.a xxx
					prev = 1
				}else{ //xxx.aaa xxx
					prev = 3
				}
				fmt.Printf("%s\n",strs[i+1][:prev])
			}
			fmt.Printf("%s.%s\n",strs[i][prev:],strs[i+1])
		}
	}

}

package main

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

func main()  {
	var str string
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanLines)
	scanner.Scan()
	str = scanner.Text()
	var i int = 0
	for ; i < len(str); i++{
		if str[i] == '.'{break}
	}
	if i > 8 || i==0 {
		if len(str) > 20 && str[:15] == "acabaea.aadabac"{
			fmt.Printf("1len %v, str %s",i,str[i-20:i])
		}
		fmt.Printf("NO")

	}else{
		prev := i + 1
		i++
		for ; i < len(str); i++{
			if str[i] == '.'{
				if i - prev > 11 || i - prev < 2{
					break
				}else{
					prev = i + 1
				}
			}
		}
		if i != len(str){
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Printf("2len %v, str %s",i,str[i-20:i])
			}
			fmt.Printf("NO")

		}else if i - prev > 3 || i == prev {
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Printf("3len %v, str %s",i,str[i-20:i])
			}
			fmt.Printf("NO")

		}else {
			fmt.Println("YES")
			strs := strings.Split(str,".")
			prev := 0
			for i=0; i< len(strs)-2; i++{
				fmt.Printf("%s.",strs[i][prev:])
				if len(strs[i+1]) < 4 {//xxx.a xxx
					prev = 1
				}else{ //xxx.aaa xxx
					prev = 3
				}
				fmt.Printf("%s\n",strs[i+1][:prev])
			}
			fmt.Printf("%s.%s\n",strs[i][prev:],strs[i+1])
		}
	}

}

package main

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

func main()  {
	var str string
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanLines)
	scanner.Scan()
	str = scanner.Text()
	var i int = 0
	for ; i < len(str); i++{
		if str[i] == '.'{break}
	}
	if i > 8 || i==0 {
		fmt.Println("NO")
	}else{
		prev := i + 1
		i++
		for ; i < len(str); i++{
			if str[i] == '.'{
				if i - prev > 11 || i - prev < 2{
					break
				}else{
					prev = i + 1
				}
			}
		}
		if i != len(str){
			fmt.Println("NO")
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Printf("len %v, str %s",i,str[i-20:i])
			}
		}else if i - prev > 3 || i == prev {
			fmt.Println("NO")
		}else {
			fmt.Println("YES")
			strs := strings.Split(str,".")
			prev := 0
			for i=0; i< len(strs)-2; i++{
				fmt.Printf("%s.",strs[i][prev:])
				if len(strs[i+1]) < 4 {//xxx.a xxx
					prev = 1
				}else{ //xxx.aaa xxx
					prev = 3
				}
				fmt.Printf("%s\n",strs[i+1][:prev])
			}
			fmt.Printf("%s.%s\n",strs[i][prev:],strs[i+1])
		}
	}

}

package main

import (
	"fmt"
	"strings"
)

func main()  {
	var str string
	fmt.Scan(&str)
	var i int = 0
	for ; i < len(str); i++{
		if str[i] == '.'{break}
	}
	if i > 8 {
		fmt.Println("NO")
	}else{
		prev := i + 1
		i++
		for ; i < len(str); i++{
			if str[i] == '.'{
				if i - prev > 11 || i - prev < 2{
					break
				}else{
					prev = i + 1
				}
			}
		}
		if i != len(str){
			fmt.Println("NO")
		}else if i - prev > 3 {
			fmt.Println("NO")
		}else {
			fmt.Println("YES")
			strs := strings.Split(str,".")
			prev := 0
			for i=0; i< len(strs)-2; i++{
				fmt.Printf("%s.",strs[i][prev:])
				if len(strs[i+1]) < 4 {//xxx.a xxx
					prev = 1
				}else{ //xxx.aaa xxx
					prev = 3
				}
				fmt.Printf("%s\n",strs[i+1][:prev])
			}
			fmt.Printf("%s.%s\n",strs[i][prev:],strs[i+1])
		}
	}

}

package main

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

func main()  {
	var str string
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanLines)
	scanner.Scan()
	str = scanner.Text()
	var i int = 0
	for ; i < len(str); i++{
		if str[i] == '.'{break}
	}
	if i > 8 || i==0 {
		if len(str) > 20 && str[:15] == "acabaea.aadabac"{
			fmt.Println("YES")
			fmt.Printf("1len %v, str %s",i,str[i-20:i])
		}
		fmt.Printf("NO")

	}else{
		prev := i + 1
		i++
		for ; i < len(str); i++{
			if str[i] == '.'{
				if i - prev > 11 || i - prev < 2{
					break
				}else{
					prev = i + 1
				}
			}
		}
		if i != len(str){
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Printf("2len %v, str %s",i,str[i-20:i])
			}
			fmt.Printf("NO")

		}else if i - prev > 3 || i == prev {
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Println("YES")
				fmt.Printf("3len %v, str %s",i,str[i-20:i])
			}
			fmt.Printf("NO")

		}else {
			fmt.Println("YES")
			strs := strings.Split(str,".")
			prev := 0
			for i=0; i< len(strs)-2; i++{
				fmt.Printf("%s.",strs[i][prev:])
				if len(strs[i+1]) < 4 {//xxx.a xxx
					prev = 1
				}else{ //xxx.aaa xxx
					prev = 3
				}
				fmt.Printf("%s\n",strs[i+1][:prev])
			}
			fmt.Printf("%s.%s\n",strs[i][prev:],strs[i+1])
		}
	}

}

package main

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

func main()  {
	var str string
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanLines)
	scanner.Scan()
	str = scanner.Text()
	var i int = 0
	for ; i < len(str); i++{
		if str[i] == '.'{break}
	}
	if i > 8 || i==0 {
		if len(str) > 20 && str[:15] == "acabaea.aadabac"{
			fmt.Println("YES")
			fmt.Printf("1len %v, str %s",i,str[i-20:i])
		}
		fmt.Printf("NO")

	}else{
		prev := i + 1
		i++
		for ; i < len(str); i++{
			if str[i] == '.'{
				if i - prev > 11 || i - prev < 2{
					break
				}else{
					prev = i + 1
				}
			}
		}
		if i != len(str){
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Println("YES")
				fmt.Printf("2len %v, str %s",i,str[i-20:i])
			}
			fmt.Printf("NO")

		}else if i - prev > 3 || i == prev {
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Println("YES")
				fmt.Printf("3len %v, str %s",i,str[i-20:i])
			}
			fmt.Printf("NO")

		}else {
			fmt.Println("YES")
			strs := strings.Split(str,".")
			prev := 0
			for i=0; i< len(strs)-2; i++{
				fmt.Printf("%s.",strs[i][prev:])
				if len(strs[i+1]) < 4 {//xxx.a xxx
					prev = 1
				}else{ //xxx.aaa xxx
					prev = 3
				}
				fmt.Printf("%s\n",strs[i+1][:prev])
			}
			fmt.Printf("%s.%s\n",strs[i][prev:],strs[i+1])
		}
	}

}

package main

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

func main()  {
	var str string
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanLines)
	scanner.Scan()
	str = scanner.Text()
	var i int = 0
	for ; i < len(str); i++{
		if str[i] == '.'{break}
	}
	if i > 8 || i==0 {
		fmt.Println("NO")
	}else{
		prev := i + 1
		i++
		for ; i < len(str); i++{
			if str[i] == '.'{
				if i - prev > 11 || i - prev < 2{
					break
				}else{
					prev = i + 1
				}
			}
		}
		if i != len(str){
			fmt.Println("NO")
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Printf("len %v, str %s",i,str[i-20:i])
			}
		}else if i - prev > 3 || i == prev {
			fmt.Println("NO")
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Printf("len %v, str %s",i,str[i-20:i])
			}
		}else {
			fmt.Println("YES")
			strs := strings.Split(str,".")
			prev := 0
			for i=0; i< len(strs)-2; i++{
				fmt.Printf("%s.",strs[i][prev:])
				if len(strs[i+1]) < 4 {//xxx.a xxx
					prev = 1
				}else{ //xxx.aaa xxx
					prev = 3
				}
				fmt.Printf("%s\n",strs[i+1][:prev])
			}
			fmt.Printf("%s.%s\n",strs[i][prev:],strs[i+1])
		}
	}

}

package main

import (
	"fmt"
	"strings"
)

func main()  {
	var str string
	fmt.Scan(&str)
	var i int = 0
	for ; i < len(str); i++{
		if str[i] == '.'{break}
	}
	if i > 8 || i==0 {
		fmt.Println("NO")
	}else{
		prev := i + 1
		i++
		for ; i < len(str); i++{
			if str[i] == '.'{
				if i - prev > 11 || i - prev < 2{
					break
				}else{
					prev = i + 1
				}
			}
		}
		if i != len(str){
			fmt.Println("NO")
		}else if i - prev > 3 {
			fmt.Println("NO")
		}else {
			fmt.Println("YES")
			strs := strings.Split(str,".")
			prev := 0
			for i=0; i< len(strs)-2; i++{
				fmt.Printf("%s.",strs[i][prev:])
				if len(strs[i+1]) < 4 {//xxx.a xxx
					prev = 1
				}else{ //xxx.aaa xxx
					prev = 3
				}
				fmt.Printf("%s\n",strs[i+1][:prev])
			}
			fmt.Printf("%s.%s\n",strs[i][prev:],strs[i+1])
		}
	}

}

package main

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

func main()  {
	var str string
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanLines)
	scanner.Scan()
	str = scanner.Text()
	var i int = 0
	for ; i < len(str); i++{
		if str[i] == '.'{break}
	}
	if i > 8 || i==0 {
		fmt.Printf("NO")
		if len(str) > 20 && str[:15] == "acabaea.aadabac"{
			fmt.Printf("len %v, str %s",i,str[i-20:i])
		}
	}else{
		prev := i + 1
		i++
		for ; i < len(str); i++{
			if str[i] == '.'{
				if i - prev > 11 || i - prev < 2{
					break
				}else{
					prev = i + 1
				}
			}
		}
		if i != len(str){
			fmt.Printf("NO")
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Printf("len %v, str %s",i,str[i-20:i])
			}
		}else if i - prev > 3 || i == prev {
			fmt.Printf("NO")
			if len(str) > 20 && str[:15] == "acabaea.aadabac"{
				fmt.Printf("len %v, str %s",i,str[i-20:i])
			}
		}else {
			fmt.Println("YES")
			strs := strings.Split(str,".")
			prev := 0
			for i=0; i< len(strs)-2; i++{
				fmt.Printf("%s.",strs[i][prev:])
				if len(strs[i+1]) < 4 {//xxx.a xxx
					prev = 1
				}else{ //xxx.aaa xxx
					prev = 3
				}
				fmt.Printf("%s\n",strs[i+1][:prev])
			}
			fmt.Printf("%s.%s\n",strs[i][prev:],strs[i+1])
		}
	}

}

package main

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

func main()  {
	var str string
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanLines)
	scanner.Scan()
	str = scanner.Text()
	var i int = 0
	for ; i < len(str); i++{
		if str[i] == '.'{break}
	}
	if i > 8 || i==0 {
		fmt.Println("NO")
	}else{
		prev := i + 1
		i++
		for ; i < len(str); i++{
			if str[i] == '.'{
				if i - prev > 11 || i - prev < 2{
					break
				}else{
					prev = i + 1
				}
			}
		}
		if i != len(str){
			fmt.Println("NO")
		}else if i - prev > 3 || i == prev {
			fmt.Println("NO")
		}else {
			fmt.Println("YES")
			strs := strings.Split(str,".")
			prev := 0
			for i=0; i< len(strs)-2; i++{
				fmt.Printf("%s.",strs[i][prev:])
				if len(strs[i+1]) < 4 {//xxx.a xxx
					prev = 1
				}else{ //xxx.aaa xxx
					prev = 3
				}
				fmt.Printf("%s\n",strs[i+1][:prev])
			}
			fmt.Printf("%s.%s\n",strs[i][prev:],strs[i+1])
		}
	}

}


«Polygon» is a system which allows to create programming tasks in a simple and professional way. When you add a test to the problem, the corresponding form asks you for the test index. As in most cases it is clear which index the next test will have, the system suggests the default value of the index. It is calculated as the smallest positive integer which is not used as an index for some previously added test.You are to implement this feature. Create a program which determines the default index of the next test, given the indexes of the previously added tests.

The first line contains one integer n (1 ≤ n ≤ 3000) — the amount of previously added tests. The second line contains n distinct integers a1, a2, ..., an (1 ≤ ai ≤ 3000) — indexes of these tests.

Output the required default value for the next test index.

package main

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

var r *bufio.Reader = bufio.NewReader(os.Stdin)
var w *bufio.Writer = bufio.NewWriter(os.Stdout)

const Max = 3000

func solve(ar []int) int {
	sort.Ints(ar)
	ans := 1
	for n := len(ar); ans <= n; ans++ {
		if ans != ar[ans-1] {
			break
		}
	}

	return ans
}

func main() {
	defer w.Flush()

	var n int
	fmt.Fscanf(r, "%d\n", &n)
	ar := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscanf(r, "%d ", &ar[i])
	}

	fmt.Fprintf(w, "%v", solve(ar))
}

package main

import "os"
import "bufio"
import "strconv"

func main(){
	var n int
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n, _ = strconv.Atoi(r.Text())
	a := make([]int, 3002)
	var x int
	for i:=0; i<n; i++ {
		r.Scan()
		x, _ = strconv.Atoi(r.Text())
		a[x] = 1
	}
	for j:=1; j<=3001; j++ {
		if a[j] != 1 {
			w.WriteString(strconv.Itoa(j)+"\n")
			w.Flush()
			return
		}
	}
}

package main

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

func main() {
    var n,i,t int
    a:=make([]bool,3005)
    fmt.Scan(&n)
    for i=0;i<n;i++ {
    	fmt.Scan(&t)
    	a[t]=true
    }
    for i=1;a[i]==true;i++ {
    }
    fmt.Println(i)
}

package main

import(
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
	"strings"
)
func Abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func main(){
	reader := bufio.NewReader(os.Stdin)
	line, _ := reader.ReadString('\n')

	line, _ = reader.ReadString('\n')
	numString := strings.Fields(line)
	nums := make([]int, len(numString))
	var temp int
	for i, s := range numString {
		temp, _ = strconv.Atoi(s)
		nums[i] = temp
	}
	sort.Ints(nums)

	var lo = 0
	var hi = len(nums) - 1
	var mid = (lo + hi) / 2
	for lo != hi {
		if nums[mid] == mid+1 {
			lo = mid
		} else {
			hi = mid
		}
		mid = (lo + hi) / 2

		// end case
		if Abs(hi-lo) == 1 {
			if nums[lo] != lo+1 {
				mid = lo
				break
			} else {
				mid = hi
				break
			}
		}
	}

	if nums[mid] != mid + 1 {
		fmt.Println(mid+1)
	} else {
		fmt.Println(mid+2)
	}
}

package main

import (
    "fmt"
    "sort"
)

func main() {
    var n int
    fmt.Scan(&n)
    a := make([]int,n)
    for i := 0; i < n; i++ { fmt.Scan(&a[i]) }
    sort.Ints(a)
    ans := 1
    for i := 0; i < n; i++ {
        if ans < a[i] {
            break
        } else {
            ans++
        }
    }
    fmt.Println(ans)
}

package main

import (
    "fmt"
    "sort"
)

func main() {
    var n int // variabel n adalah integer
    fmt.Scan(&n) // meminta input n
    a := make([]int,n) // membuat array of integer yang dimasukan ke dalam variabel a
    for i := 0; i < n; i++ { fmt.Scan(&a[i]) } // lakukan selama kondisi dan meminta input a
    sort.Ints(a) // mensortir a
    ans := 1 // variabel ans adalah integer yang isinya adalah 1
    for i := 0; i < n; i++ { // lakukan selama kondisi ini
        if ans < a[i] { // kondisi
            break // berhenti
        } else {// jika tidak
            ans++ // lakukan terus sampai kondisi selesai
        }
    }
    fmt.Println(ans) // memncetak output ans
}

package main

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

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

	testCount := 0
	if scanner.Scan() {
		line := scanner.Text()

		fmt.Sscanf(line, "%d", &testCount)
	}

	if scanner.Scan() {
		line := scanner.Text()

		indexes := strings.Fields(line)
		indexesInt := make(sort.IntSlice, testCount)
		for i, val := range indexes {
			indexesInt[i], _ = strconv.Atoi(val)
		}

		sort.Sort(indexesInt)

		for i := 0; i < testCount; i++ {
			if indexesInt[i] != i+1 {
				fmt.Println(i + 1)
				return
			}
		}
		fmt.Println(testCount + 1)
	}
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d\n", &n)

	taken := make(map[int]bool)
	for i := 0; i < n; i++ {
		var e int
		fmt.Scanf("%d", &e)
		taken[e] = true
	}

	idx := 1
	for taken[idx] {
		idx++
	}

	fmt.Printf("%d\n", idx)
}

package main

import . "fmt"

func main() {
	var n, v int
	var used [3002]bool
	Scan(&n)
	for ; n > 0; n-- {
		Scan(&v)
		used[v] = true
	}
	for i := 1; ; i++ {
		if !used[i] {
			Print(i)
			return
		}
	}
}

package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

const MAX = 3000

func main() {
	var a, n int
	seen := make([]bool, MAX)

	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		scanf("%d", &a)
		seen[a-1] = true
	}
	for i := 0; i < MAX; i++ {
		if !seen[i] {
			fmt.Println(i+1)
			return
		}
	}
	fmt.Println(MAX+1)
}

// 27A
package main

import (
	"fmt"
)

func main() {
	var f [3005]int
	var n, d int
	fmt.Scan(&n)
	for i := 1; i <= n; i++ {
		fmt.Scan(&d)
		f[d]++
	}
	for i := 1; i <= 3005; i++ {
		if f[i] == 0 {
			d = i
			break
		}
	}
	fmt.Println(d)
}

// 27A-mic
package main

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

func main() {
    var n int
    z := bufio.NewReader(os.Stdin)
    fmt.Scan(&n)
    a := make([]int, n)
    for i := 0; i < n; i++ {
        fmt.Fscan(z, &a[i])
    }
    sort.Sort(sort.IntSlice(a))
    m := 0
    for i := 1; i < 3100; i++ {
        if m < n && a[m] == i {
            m++
        } else {
            fmt.Println(i)
            return
        }
    }
}

package main

import "os"
import "bufio"
import "strconv"

func main(){
	var n int
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n, _ = strconv.Atoi(r.Text())
	a := make([]int, 3001)
	var x int
	for i:=0; i<n; i++ {
		r.Scan()
		x, _ = strconv.Atoi(r.Text())
		a[x] = 1
	}
	for j:=1; j<3001; j++ {
		if a[j] != 1 {
			w.WriteString(strconv.Itoa(j)+"\n")
			w.Flush()
			return
		}
	}
}

package main

import (
    "fmt"
    "sort"
)

func main() {
    var n int
    fmt.Scan(&n)
    a := make([]int,n)
    for i := 0; i < n; i++ { fmt.Scan(&a[i]) }
    sort.Ints(a)
    ans := a[n-1]+1
    for i := 0; i < (n-1); i++ {
        if (a[i]+1) != a[i+1] {
            ans = a[i]+1
            break
        }
    }
    fmt.Println(ans)
}

package main

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

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

	testCount := 0
	if scanner.Scan() {
		line := scanner.Text()

		fmt.Sscanf(line, "%d", &testCount)
	}

	if scanner.Scan() {
		line := scanner.Text()

		indexes := strings.Fields(line)
		indexesInt := make(sort.IntSlice, testCount)
		for i, val := range indexes {
			indexesInt[i], _ = strconv.Atoi(val)
		}

		sort.Sort(indexesInt)

		for i := 0; i < testCount; i++ {
			if indexesInt[i] != i+1 {
				fmt.Println(i + 1)
				return
			}

		}
	}
}

package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

const MAX = 3000

func main() {
	var a, n int
	seen := make([]bool, MAX)

	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		scanf("%d", &a)
		seen[a-1] = true
	}
	for i := 0; i < MAX; i++ {
		if !seen[i] {
			fmt.Println(i+1)
			return
		}
	}
}

// 27A-mic
package main

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

func main() {
    var n int
    z := bufio.NewReader(os.Stdin)
    fmt.Scan(&n)
    a := make([]int, n)
    for i := 0; i < n; i++ {
        fmt.Fscan(z, &a[i])
    }
    sort.Sort(sort.IntSlice(a))
    m := a[0]
    for i := 1; i < n; i++ {
        if m+1 != a[i] {
            break
        }
        m = a[i]
    }
    fmt.Println(m + 1)
}

// 27A-mic
package main

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

func main() {
	var n int
	z := bufio.NewReader(os.Stdin)
	fmt.Scan(&n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(z, &a[i])
	}
	sort.Sort(sort.IntSlice(a))
	m := 0
	for i := 1; i < 3000; i++ {
		if m < n && a[m] == i {
			m++
		} else {
			fmt.Println(i)
			return
		}
	}
}


You have a board represented as a grid with $$$2 \times n$$$ cells.The first $$$k_1$$$ cells on the first row and first $$$k_2$$$ cells on the second row are colored in white. All other cells are colored in black.You have $$$w$$$ white dominoes ($$$2 \times 1$$$ tiles, both cells are colored in white) and $$$b$$$ black dominoes ($$$2 \times 1$$$ tiles, both cells are colored in black).You can place a white domino on the board if both board's cells are white and not occupied by any other domino. In the same way, you can place a black domino if both cells are black and not occupied by any other domino.Can you place all $$$w + b$$$ dominoes on the board if you can place dominoes both horizontally and vertically?

The first line contains a single integer $$$t$$$ ($$$1 \le t \le 3000$$$) — the number of test cases. The first line of each test case contains three integers $$$n$$$, $$$k_1$$$ and $$$k_2$$$ ($$$1 \le n \le 1000$$$; $$$0 \le k_1, k_2 \le n$$$). The second line of each test case contains two integers $$$w$$$ and $$$b$$$ ($$$0 \le w, b \le n$$$).

For each test case, print YES if it's possible to place all $$$w + b$$$ dominoes on the board and NO, otherwise. You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES are all recognized as positive answer).

NoteIn the first test case, $$$n = 1$$$, $$$k_1 = 0$$$ and $$$k_2 = 1$$$. It means that $$$2 \times 1$$$ board has black cell $$$(1, 1)$$$ and white cell $$$(2, 1)$$$. So, you can't place any white domino, since there is only one white cell.In the second test case, the board of the same size $$$2 \times 1$$$, but both cell are white. Since $$$w = 0$$$ and $$$b = 0$$$, so you can place $$$0 + 0 = 0$$$ dominoes on the board.In the third test case, board $$$2 \times 3$$$, but fully colored in black (since $$$k_1 = k_2 = 0$$$), so you can't place any white domino.In the fourth test case, cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, and $$$(2, 1)$$$ are white and other cells are black. You can place $$$2$$$ white dominoes at positions $$$((1, 1), (2, 1))$$$ and $$$((1, 2), (1, 3))$$$ and $$$2$$$ black dominoes at positions $$$((1, 4), (2, 4))$$$ $$$((2, 2), (2, 3))$$$.

package main
import(
    "fmt"
    "bufio"
    "os"
)
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n,k1,k2 int
		fmt.Fscan(in,&n,&k1,&k2)
		var w,b int
		fmt.Fscan(in,&w,&b)
		w_available:= abs(k1-k2)/2 + min(k1,k2)
		b_available:= abs((n-k1)-(n-k2))/2 + min(n-k1,n-k2)
		if w > w_available || b > b_available {
			fmt.Fprintln(out,"NO")
		} else {
			fmt.Fprintln(out,"YES")
		}
	}
}

func abs(x int) int {
	if x < 0 {
		return x*-1
	}
	return x
}
func min(a,b int) int {
	if a>=b{
		return b
	}
	return a
}

package main
import "fmt"
func main() {
    var T, n, k1, k2, w, b int
    fmt.Scanf("%d\n", &T)
    for t := 1; t <= T; t++ {
        fmt.Scanf("%d %d %d\n", &n, &k1, &k2)
        fmt.Scanf("%d %d\n", &w, &b)
        sw := (k1 + k2) / 2
        sb := (n * 2 - k1 - k2) / 2
        if sw >= w && sb >= b {
            fmt.Print("YES")
        } else {
            fmt.Print("NO")
        }
        fmt.Println()
    }
}

package main

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

var sc = bufio.NewScanner(os.Stdin)
var wr = bufio.NewWriter(os.Stdout)

func solve() {
	n, k1, k2 := getI(), getI(), getI()
	w, b := getI(), getI()

	whites := (k1 + k2) / 2
	blacks := ((n * 2) - (k1 + k2)) / 2

	if whites >= w && blacks >= b {
		out("YES")
	} else {
		out("NO")
	}
}

// http://github.com/KadoBOT (me@ricardoambrogi.com)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 4096), 1e9)
	for i := getI(); i > 0; i-- {
		solve()
	}
	out()
}

// !------- HELPERS -------!
func out(x ...interface{}) {
	fmt.Fprintln(wr, x...)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(wr, f, a...)
}

func getI() int64 {
	s := getS()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func getF() float64 {
	sc.Scan()
	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func getInts(N int64) []int64 {
	ret := make([]int64, N)
	for i := range ret {
		ret[i] = getI()
	}
	return ret
}

func getS() string {
	if !sc.Scan() {
		panic(sc.Err())
	}
	return sc.Text()
}

func ceil(n, d int64) int64 {
	return (n + d - 1) / d
}

func nsort(data ...int64) []int64 {
	sort.SliceStable(data, func(i, j int) bool { return data[i] < data[j] })
	return data
}

func nsorti(data ...int64) []int64 {
	idxs := make([]int64, len(data))
	for i := 0; i < len(data); i++ {
		idxs[i] = int64(i)
	}

	sort.SliceStable(idxs, func(i, j int) bool { return data[idxs[i]] < data[idxs[j]] })
	return idxs
}

func nsum(data ...int64) int64 {
	var res int64
	for _, n := range data {
		res += n
	}
	return res
}

func njoin(s ...int64) string {
	return strings.Trim(fmt.Sprintf("%v", s), "[]")
}

func forEach(n int64, fn func(int64)) {
	for i := int64(0); i < n; i++ {
		fn(i)
	}
}

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

// min, max, asub, abs
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
}

// min for n entry
func nmin(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = min(ret, e)
	}
	return ret
}

// max for n entry
func nmax(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = max(ret, e)
	}
	return ret
}

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

func abs(a int64) int64 {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

// !------- FORMULAS -------!
func gcd(a, b int64) int64 {
	for b != 0 {
		t := b
		b = a % b
		a = t
	}
	return a
}

func lcm(a, b int64, integers ...int64) int64 {
	result := a * b / gcd(a, b)

	for i := 0; i < len(integers); i++ {
		result = lcm(result, integers[i])
	}

	return result
}

func sieve(n int64) []int64 {
	integers := make([]bool, n+1)
	for i := int64(2); i < n+1; i++ {
		integers[i] = true
	}

	for p := int64(2); p*p <= n; p++ {
		if integers[p] == true {
			for i := p * 2; i <= n; i += p {
				integers[i] = false
			}
		}
	}

	var primes []int64
	for p := int64(2); p <= n; p++ {
		if integers[p] == true {
			primes = append(primes, p)
		}
	}

	return primes
}

package main

import (
	"fmt"
)

func main() {
	var tests int
	fmt.Scan(&tests)

	for i := 0; i < tests; i++ {
		var n, k1, k2 int
		fmt.Scan(&n, &k1, &k2)

		var w, b int
		fmt.Scan(&w, &b)

		area := n * 2
		whiteArea := k1 + k2
		blackArea := area - whiteArea

		if w * 2 <= whiteArea && b * 2 <= blackArea {
			fmt.Println("YES")
		}else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var N int
	_, _ = fmt.Scan(&N)
	for i := 0; i < N; i++ {
		var n, k1, k2, w, b int
		_, _ = fmt.Scan(&n, &k1, &k2, &w, &b)
		if w*2 <= k1+k2 && b*2 <= (n*2-k1-k2) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
	"math/big"
)

var ret *big.Int

func isPrime(x int) bool {
	for i := 2; i < x; i++ {
		if x % i == 0 {
			return false
		}
	}
	return true
}

func dfs(dep, maxDep, n int, a, primeArr []int32, used []bool) {
	if dep == maxDep {
		cur := big.NewInt(1)
		for i := 0; i < n; i++ {
			curFlag := false
			for j := 0; j < maxDep; j++ {
				if used[j] && a[i] % primeArr[j] == 0 {
					curFlag = true
				}
			}
			if !curFlag {
				return
			}
		}
		for i := 0; i < maxDep; i++ {
			if used[i] {
				cur.Mul(cur, big.NewInt(int64(primeArr[i])))
			}
		}
		//fmt.Println(cur)
		if ret.Cmp(big.NewInt(0)) == 0 || -1 == cur.Cmp(ret) {
			ret = cur
		}
		return
	}
	used[dep] = true
	dfs(dep + 1, maxDep, n, a, primeArr, used)
	used[dep] = false
	dfs(dep + 1, maxDep, n, a, primeArr, used)
}

func main() {
	input()
}

func input() {
	var T int
	fmt.Scan(&T)
	for i := 0; i < T; i++ {
		var n, k1, k2, w, b int
		fmt.Scan(&n, &k1, &k2, &w, &b)
		fmt.Println(answer(n, k1, k2, w, b))
	}
}

func answer(n, k1, k2, w, b int) string {
	minK := min(k1, k2)
	maxK := max(k1, k2)
	if w > minK + (maxK - minK) / 2 {
		return "NO"
	}
	minK = min(n - k1, n - k2)
	maxK = max(n - k1, n - k2)
	if b > minK + (maxK - minK) / 2 {
		return "NO"
	}
	return "YES"
}

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
}

package main

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

/*
2
6 3 4
3 2
6 3 4
4 1
---
YES
NO

WWWBBB
WWWWBB

B
W
*/

//goland:noinspection GoUnhandledErrorResult
func solve() {
	var n, k1, k2 int
	scanf("%d %d %d\n", &n, &k1, &k2)

	var w, b int
	scanf("%d %d\n", &w, &b)

	wCnt := (k1 + k2) / 2
	bCnt := (2*n - k1 - k2) / 2
	if w > wCnt || b > bCnt {
		fmt.Fprintln(writer, "NO")
		return
	}

	fmt.Fprintln(writer, "YES")
}

//goland:noinspection GoUnhandledErrorResult
func main() {
	defer writer.Flush()

	t := 1
	scanf("%d\n", &t)

	for ; t > 0; t-- {
		solve()
	}
}

const maxUint = ^uint(0)

//goland:noinspection GoUnusedConst
const minUint = 0
const maxInt = int(maxUint >> 1)

//goland:noinspection GoUnusedConst
const minInt = -maxInt - 1

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

func scanf(f string, a ...interface{}) {
	if _, err := fmt.Fscanf(reader, f, a...); err != nil {
		panic(err)
	}
}

//goland:noinspection GoUnusedFunction
func reversed(s string) string {
	input := []rune(s)
	li := len(input)
	ret := make([]rune, li)
	for i, r := range input {
		ret[li-i-1] = r
	}
	return string(ret)
}

//goland:noinspection GoUnusedFunction
func divCeil(num, div int64) int64 {
	quot := num / div
	if num%div > 0 {
		quot++
	} else if num%div < 0 {
		quot--
	}
	return quot
}

//goland:noinspection GoUnusedFunction
func min(nums ...int) int {
	return nums[minIdx(nums...)]
}

//goland:noinspection GoUnusedFunction
func minIdx(nums ...int) int {
	minNumIdx := 0
	for i, num := range nums {
		if num < nums[minNumIdx] {
			minNumIdx = i
		}
	}

	return minNumIdx
}

//goland:noinspection GoUnusedFunction
func max(nums ...int) int {
	return nums[maxIdx(nums...)]
}

//goland:noinspection GoUnusedFunction
func maxIdx(nums ...int) int {
	maxNumIdx := 0
	for i, num := range nums {
		if num > nums[maxNumIdx] {
			maxNumIdx = i
		}
	}

	return maxNumIdx
}

//goland:noinspection GoUnusedFunction
func abs(num int) int {
	if num < 0 {
		return -num
	}
	return num
}

//goland:noinspection GoUnusedFunction
func isPrime(num int) bool {
	if num == 2 || num == 3 {
		return true
	}

	if num <= 1 || num%2 == 0 || num%3 == 0 {
		return false
	}

	for i := 5; i*i <= num; i += 6 {
		if num%i == 0 || num%(i+2) == 0 {
			return false
		}
	}

	return true
}

//goland:noinspection GoUnusedFunction
func gcd(a, b int) int {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

//goland:noinspection GoUnusedFunction
func lcm(a, b int) int {
	return abs(a) / gcd(a, b) * abs(b)
}

// Examples:
//	digitAt(1234, -1) -> panic!
//	digitAt(1234, 0) -> 4
//	digitAt(1234, 1) -> 3
//	digitAt(1234, 2) -> 2
//	digitAt(1234, 3) -> 1
//	digitAt(1234, 4) -> panic!
//goland:noinspection GoUnusedFunction
func digitAt(num, pos int) int {
	if num == 0 {
		return 0
	}

	num = abs(num)

	lenNum := int(math.Log10(float64(num))) + 1
	if pos < 0 || pos >= lenNum {
		err := fmt.Sprintf("Out of bound access for digit. Position passed %d, number %d", pos, num)
		panic(err)
	}

	rem := num % int(math.Pow10(pos+1))
	return rem / int(math.Pow10(pos))
}

//goland:noinspection GoUnusedFunction
func factorize(num int) []int {
	factors := []int{1}

	sqrtA := int(math.Sqrt(float64(num)))

	for ftr := 2; ftr <= sqrtA; ftr++ {
		for num%ftr == 0 {
			num /= ftr
			factors = append(factors, ftr)
		}
	}

	if num > sqrtA {
		factors = append(factors, num)
	}

	return factors
}

package main

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

type CF1499A struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1499A) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1499A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1499A) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1499A) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1499A) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
Run solve the problem CF1499A
Date: 22/01/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1499/A
Problem: CF1499A
**/
func (in *CF1499A) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n, k1, k2 := in.NextInt(), in.NextInt(), in.NextInt()
		w, b := in.NextInt(), in.NextInt()
		k1b, k2b := n-k1, n-k2
		ans := "YES"
		if k1+k2 >= 2*w && k1b+k2b >= 2*b || (w == 0 && b == 0) {

		} else {
			ans = "NO"
		}
		fmt.Println(ans)
	}
}

func NewCF1499A(r *bufio.Reader) *CF1499A {
	return &CF1499A{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1499A(bufio.NewReader(os.Stdin)).Run()
}

package main

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

var (
	reader             = bufio.NewReader(os.Stdin)
	t, n, k1, k2, w, b int
)

func solve(n, k1, k2, w, b int) string {
	if k1 < k2 {
		k1, k2 = k2, k1
	}
	if w > k2+(k1-k2)/2 {
		return "NO"
	}
	if b > (n-k1)+(k1-k2)/2 {
		return "NO"
	}
	return "YES"
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &n, &k1, &k2, &w, &b)
		fmt.Println(solve(n, k1, k2, w, b))
	}
}

package main

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

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

	tc := readNum(reader)

	var buf bytes.Buffer

	for tc > 0 {
		tc--
		n, k1, k2 := readThreeNums(reader)
		w, b := readTwoNums(reader)
		res := solve(n, k1, k2, w, b)
		if res {
			buf.WriteString("YES\n")
		} else {
			buf.WriteString("NO\n")
		}
	}

	fmt.Print(buf.String())
}

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 solve(n int, k1, k2 int, w int, b int) bool {
	x := k1 + k2
	if 2*w > x {
		return false
	}
	y := 2*n - x
	if 2*b > y {
		return false
	}
	return true
}

package main

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

var bytes []byte

func nextByte() byte {
	b := bytes[0]
	bytes = bytes[1:]
	return b
}

func ScanInt64() int64 {
	var negative bool
	var result int64

	b := nextByte()

	for ; b < '0' || b > '9'; b = nextByte() {
		if b == '-' {
			negative = true
		}
	}

	for ; '0' <= b && b <= '9'; b = nextByte() {
		result = (result << 3) + (result << 1) + int64(b-'0')
	}

	if negative {
		return -result
	} else {
		return result
	}
}

func ScanInt() int {
	return int(ScanInt64())
}

func ScanString() string {
	builder := strings.Builder{}

	for b := nextByte(); b != '\r'; b = nextByte() {
		if b != '\n' {
			builder.WriteByte(b)
		}
	}

	return builder.String()
}

func init() {
	f, err := os.Open("in.txt")

	if err == nil {
		defer f.Close()
	} else {
		f = os.Stdin
	}

	bytes, _ = ioutil.ReadAll(bufio.NewReader(f))
}

type Package struct {
	x, y int
}

type Packages []Package

func (p Packages) Len() int { return len(p) }

func (p Packages) Swap(i, j int) { p[i], p[j] = p[j], p[i] }

func (p Packages) Less(i, j int) bool {
	if p[i].x != p[j].x {
		return p[i].x < p[j].x
	} else {
		return p[i].y < p[j].y
	}
}

func main() {
	for t := ScanInt(); t > 0; t-- {
		n, k1, k2 := ScanInt(), ScanInt(), ScanInt()
		w, b := ScanInt(), ScanInt()

		if 2*w <= k1+k2 && 2*b <= 2*n-k1-k2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import "fmt"

func main() {
	var t int
	var n, k1, k2 int
	var w, b int
	fmt.Scanln(&t)
	for i := 0; i < t; i++ {
		fmt.Scanln(&n, &k1, &k2)
		fmt.Scanln(&w, &b)
		if ((k1+k2)/2 >= w) && ((2*n-k1-k2)/2 >= b) {
			fmt.Println("YES")
			continue
		}
		fmt.Println("NO")
	}
}

package main

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

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

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 main() {
	defer writer.Flush()
	//redirectInputToFile(reader, "input.txt")

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

// --------------------------------------------------------------------- //

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

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

func solve() {
	var n, k1, k2, w, b int
	scan(&n, &k1, &k2, &w, &b)

	maxW := min(k1, k2) + (max(k1, k2)-min(k1, k2))/2
	k1, k2 = n-k1, n-k2
	maxB := min(k1, k2) + (max(k1, k2)-min(k1, k2))/2
	if maxW >= w && maxB >= b {
		printf("yes\n")
	} else {
		printf("no\n")
	}
}

package main

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

// var m []int
// err = json.Unmarshal([]byte(r.FormValue("example")), &m)

// for i := 0; i < len(m); i++ {
// 	fmt.Println(m[i])
// }

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

func MKO(x, y int) int {
	if x < y {
		return 0
	} else {
		return x - y + 1
	}
}

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

func LCM(x, y int) int {
	if x >= y {
		initial := x
		for i := 1; i < y+2; i++ {
			if initial%y == 0 {
				break
			} else {
				initial = initial + x
			}

		}
		return initial
	} else {
		initial := y
		for i := 1; i < x+2; i++ {
			if initial%x == 0 {
				break
			} else {
				initial = initial + y
			}

		}
		return initial
	}
}

func IsItPrime(x int) bool {
	if x < 10 {
		if x == 2 || x == 3 || x == 5 || x == 7 {
			return true
		} else {
			return false
		}
	} else {
		j := 0
		k := math.Sqrt(float64(x))
		for m := 3; m <= int(k); {
			if x%m == 0 {
				j = 1
				break
			}
			m = m + 2
		}
		if j == 1 {
			return false
		} else {
			return true
		}
	}

}

// sort.Slice(arr, func(i, j int) bool {
// 	return arr[i] > arr[j]
// })
var t int

func main() {
	var input io.Reader = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &t)
	for o := 0; o < t; o++ {
		var n, k, kk int
		var w, b int

		fmt.Fscan(input, &n)
		fmt.Fscan(input, &k)
		fmt.Fscan(input, &kk)
		fmt.Fscan(input, &w)
		fmt.Fscan(input, &b)

		// STRING := make([]byte, 0)
		// fmt.Fscan(input, &STRING)

		// ARRAY := make([]int, n)

		// for i := 0; i < n; i++ {
		// 	fmt.Fscan(input, &ARRAY[i])
		// }

		WHITE := int((MAX(k, kk)-MIN(k, kk))/2) + MIN(k, kk)
		BLACK := MIN(n-k, n-kk) + int((MAX(n-k, n-kk)-MIN(n-k, n-kk))/2)

		if WHITE >= w && BLACK >= b {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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()

	solve := func(Case int)  {
		var n, k1, k2, w, b int
		Fscan(in, &n, &k1, &k2, &w, &b)
		ww := k1 + k2
		bb := 2*n - ww
		if (k1-k2)&1 > 0 {
			ww--
			bb--
		}

		if  2*w <= ww && 2*b <= bb{
			Fprintln(out, "YES")
		} else {
			Fprintln(out, "NO")
		}
	}

	var t int
	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(
    "fmt"
    "bufio"
    "os"
)
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n,k1,k2 int
		fmt.Fscan(in,&n,&k1,&k2)
		var w,b int
		fmt.Fscan(in,&w,&b)
		whites:= abs(k1-k2)/2 + min(k1,k2)
		blacks:= abs((n-k1)-n-(k2))/2 + min(n-k1,n-k2)
		if w > whites || b > blacks {
			fmt.Fprintln(out,"NO")
		} else {
			fmt.Fprintln(out,"YES")
		}
	}
}

func abs(x int) int {
	if x < 0 {
		return x*-1
	}
	return x
}
func min(a,b int) int {
	if a>=b{
		return b
	}
	return a
}

package main
import(
    "fmt"
    "bufio"
    "os"
)
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n,k1,k2 int
		fmt.Fscan(in,&n,&k1,&k2)
		var w,b int
		fmt.Fscan(in,&w,&b)
		whites:= abs(k1-k2)/2 + min(k1,k2)
		blacks:= abs((n-k1)-n-(k2))/2 + min(n-k1,n-k2)
		if w >= whites && b >= blacks {
			fmt.Fprintln(out,"NO")
		} else {
			fmt.Fprintln(out,"YES")
		}
	}
}

func abs(x int) int {
	if x < 0 {
		return x*-1
	}
	return x
}
func min(a,b int) int {
	if a>=b{
		return b
	}
	return a
}

package main
import "fmt"
func main() {
    var T, n, k1, k2, w, b int
    fmt.Scanf("%d", &T)
    for t := 1; t <= T; t++ {
        fmt.Scanf("%d %d %d", &n, &k1, &k2)
        fmt.Scanf("%d %d", &w, &b)
        sw := (k1 + k2) / 2
        sb := (n * 2 - k1 - k2) / 2
        if sw >= w && sb >= b {
            fmt.Print("YES")
        } else {
            fmt.Print("NO")
        }
        fmt.Println()
    }
}

package main
import "fmt"
func main() {
    var T, n, k1, k2, w, b int
    fmt.Scanf("%d", &T)
    for t := 1; t <= T; t++ {
        fmt.Scanf("%d%d%d", &n, &k1, &k2)
        fmt.Scanf("%d%d", &w, &b)
        sw := (k1 + k2) / 2
        sb := (n * 2 - k1 - k2) / 2
        if sw >= w && sb >= b {
            fmt.Print("YES")
        } else {
            fmt.Print("NO")
        }
        fmt.Println()
    }
}

package main

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

var sc = bufio.NewScanner(os.Stdin)
var wr = bufio.NewWriter(os.Stdout)

func solve() {
	n, k1, k2 := getI(), getI(), getI()
	w, b := getI(), getI()

	grid := [][]int64{make([]int64, n), make([]int64, n)}

	forEach(k1, func(i int64) {
		grid[0][i] = 1
	})

	forEach(k2, func(i int64) {
		grid[1][i] = 1
	})

	forEach(2, func(i int64) {
		forEach(n, func(j int64) {
			if grid[i][j] == 0 {
				if i == 0 && grid[i+1][j] == 0 {
					if b > 0 {
						b--
						grid[i][j] = 2
						grid[i+1][j] = 2
					}
				} else if j < n-2 && grid[i][j+1] == 0 {
					if b > 0 {
						b--
						grid[i][j] = 2
						grid[i][j+1] = 2
					}
				}
			}

			if grid[i][j] == 1 {
				if i == 0 && grid[i+1][j] == 1 {
					if w > 0 {
						w--
						grid[i][j] = 3
						grid[i+1][j] = 3
					}
				} else if j < n-2 && grid[i][j+1] == 1 {
					if w > 0 {
						w--
						grid[i][j] = 3
						grid[i][j+1] = 3
					}
				}
			}
		})
	})

	if w <= 0 && b <= 0 {
		out("YES")
	} else {
		out("NO")
	}
}

// http://github.com/KadoBOT (me@ricardoambrogi.com)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 4096), 1e9)
	for i := getI(); i > 0; i-- {
		solve()
	}
	out()
}

// !------- HELPERS -------!
func out(x ...interface{}) {
	fmt.Fprintln(wr, x...)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(wr, f, a...)
}

func getI() int64 {
	s := getS()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func getF() float64 {
	sc.Scan()
	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func getInts(N int64) []int64 {
	ret := make([]int64, N)
	for i := range ret {
		ret[i] = getI()
	}
	return ret
}

func getS() string {
	if !sc.Scan() {
		panic(sc.Err())
	}
	return sc.Text()
}

func ceil(n, d int64) int64 {
	return (n + d - 1) / d
}

func nsort(data ...int64) []int64 {
	sort.SliceStable(data, func(i, j int) bool { return data[i] < data[j] })
	return data
}

func nsorti(data ...int64) []int64 {
	idxs := make([]int64, len(data))
	for i := 0; i < len(data); i++ {
		idxs[i] = int64(i)
	}

	sort.SliceStable(idxs, func(i, j int) bool { return data[idxs[i]] < data[idxs[j]] })
	return idxs
}

func nsum(data ...int64) int64 {
	var res int64
	for _, n := range data {
		res += n
	}
	return res
}

func njoin(s ...int64) string {
	return strings.Trim(fmt.Sprintf("%v", s), "[]")
}

func forEach(n int64, fn func(int64)) {
	for i := int64(0); i < n; i++ {
		fn(i)
	}
}

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

// min, max, asub, abs
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
}

// min for n entry
func nmin(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = min(ret, e)
	}
	return ret
}

// max for n entry
func nmax(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = max(ret, e)
	}
	return ret
}

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

func abs(a int64) int64 {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

// !------- FORMULAS -------!
func gcd(a, b int64) int64 {
	for b != 0 {
		t := b
		b = a % b
		a = t
	}
	return a
}

func lcm(a, b int64, integers ...int64) int64 {
	result := a * b / gcd(a, b)

	for i := 0; i < len(integers); i++ {
		result = lcm(result, integers[i])
	}

	return result
}

func sieve(n int64) []int64 {
	integers := make([]bool, n+1)
	for i := int64(2); i < n+1; i++ {
		integers[i] = true
	}

	for p := int64(2); p*p <= n; p++ {
		if integers[p] == true {
			for i := p * 2; i <= n; i += p {
				integers[i] = false
			}
		}
	}

	var primes []int64
	for p := int64(2); p <= n; p++ {
		if integers[p] == true {
			primes = append(primes, p)
		}
	}

	return primes
}

package main

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

var sc = bufio.NewScanner(os.Stdin)
var wr = bufio.NewWriter(os.Stdout)

func solve() {
	n, k1, k2 := getI(), getI(), getI()
	w, b := getI(), getI()

	grid := [][]int64{make([]int64, n), make([]int64, n)}

	forEach(k1, func(i int64) {
		grid[0][i] = 1
	})

	forEach(k2, func(i int64) {
		grid[1][i] = 1
	})

	forEach(2, func(i int64) {
		forEach(n, func(j int64) {
			if grid[i][j] == 0 {
				if i == 0 && grid[i+1][j] == 0 {
					b--
				}

				if j < n-2 && grid[i][j+1] == 0 {
					b--
				}
			}

			if grid[i][j] == 1 {
				if i == 0 && grid[i+1][j] == 1 {
					w--
				}

				if j < n-2 && grid[i][j+1] == 1 {
					w--
				}
			}
		})
	})

	if w <= 0 && b <= 0 {
		out("YES")
	} else {
		out("NO")
	}
}

// http://github.com/KadoBOT (me@ricardoambrogi.com)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 4096), 1e9)
	for i := getI(); i > 0; i-- {
		solve()
	}
	out()
}

// !------- HELPERS -------!
func out(x ...interface{}) {
	fmt.Fprintln(wr, x...)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(wr, f, a...)
}

func getI() int64 {
	s := getS()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func getF() float64 {
	sc.Scan()
	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func getInts(N int64) []int64 {
	ret := make([]int64, N)
	for i := range ret {
		ret[i] = getI()
	}
	return ret
}

func getS() string {
	if !sc.Scan() {
		panic(sc.Err())
	}
	return sc.Text()
}

func ceil(n, d int64) int64 {
	return (n + d - 1) / d
}

func nsort(data ...int64) []int64 {
	sort.SliceStable(data, func(i, j int) bool { return data[i] < data[j] })
	return data
}

func nsorti(data ...int64) []int64 {
	idxs := make([]int64, len(data))
	for i := 0; i < len(data); i++ {
		idxs[i] = int64(i)
	}

	sort.SliceStable(idxs, func(i, j int) bool { return data[idxs[i]] < data[idxs[j]] })
	return idxs
}

func nsum(data ...int64) int64 {
	var res int64
	for _, n := range data {
		res += n
	}
	return res
}

func njoin(s ...int64) string {
	return strings.Trim(fmt.Sprintf("%v", s), "[]")
}

func forEach(n int64, fn func(int64)) {
	for i := int64(0); i < n; i++ {
		fn(i)
	}
}

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

// min, max, asub, abs
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
}

// min for n entry
func nmin(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = min(ret, e)
	}
	return ret
}

// max for n entry
func nmax(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = max(ret, e)
	}
	return ret
}

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

func abs(a int64) int64 {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

// !------- FORMULAS -------!
func gcd(a, b int64) int64 {
	for b != 0 {
		t := b
		b = a % b
		a = t
	}
	return a
}

func lcm(a, b int64, integers ...int64) int64 {
	result := a * b / gcd(a, b)

	for i := 0; i < len(integers); i++ {
		result = lcm(result, integers[i])
	}

	return result
}

func sieve(n int64) []int64 {
	integers := make([]bool, n+1)
	for i := int64(2); i < n+1; i++ {
		integers[i] = true
	}

	for p := int64(2); p*p <= n; p++ {
		if integers[p] == true {
			for i := p * 2; i <= n; i += p {
				integers[i] = false
			}
		}
	}

	var primes []int64
	for p := int64(2); p <= n; p++ {
		if integers[p] == true {
			primes = append(primes, p)
		}
	}

	return primes
}

package main

import (
	"fmt"
)

func main() {
	var tests int
	fmt.Scan(&tests)

	for i := 0; i < tests; i++ {
		var n, k1, k2 int
		fmt.Scan(&n, &k1, &k2)

		var w, b int
		fmt.Scan(&w, &b)

		area := n * 2
		whiteArea := area - (k1 + k2)
		blackArea := area - whiteArea

		if w <= whiteArea && b <= blackArea {
			fmt.Println("YES")
		}else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
	"math/big"
)

var ret *big.Int

func isPrime(x int) bool {
	for i := 2; i < x; i++ {
		if x % i == 0 {
			return false
		}
	}
	return true
}

func dfs(dep, maxDep, n int, a, primeArr []int32, used []bool) {
	if dep == maxDep {
		cur := big.NewInt(1)
		for i := 0; i < n; i++ {
			curFlag := false
			for j := 0; j < maxDep; j++ {
				if used[j] && a[i] % primeArr[j] == 0 {
					curFlag = true
				}
			}
			if !curFlag {
				return
			}
		}
		for i := 0; i < maxDep; i++ {
			if used[i] {
				cur.Mul(cur, big.NewInt(int64(primeArr[i])))
			}
		}
		//fmt.Println(cur)
		if ret.Cmp(big.NewInt(0)) == 0 || -1 == cur.Cmp(ret) {
			ret = cur
		}
		return
	}
	used[dep] = true
	dfs(dep + 1, maxDep, n, a, primeArr, used)
	used[dep] = false
	dfs(dep + 1, maxDep, n, a, primeArr, used)
}

func main() {
	input()
}

func input() {
	var T int
	fmt.Scan(&T)
	for i := 0; i < T; i++ {
		var n, k1, k2, w, b int
		fmt.Scan(&n, &k1, &k2, &w, &b)
		fmt.Println(answer(n, k1, k2, w, b))
	}
}

func answer(n, k1, k2, w, b int) string {
	minK := min(k1, k2)
	maxK := max(k1, k2)
	if w > minK + maxK / 2 {
		return "NO"
	}
	minK = min(n - k1, n - k2)
	maxK = max(n - k1, n - k2)
	if b > minK + maxK / 2 {
		return "NO"
	}
	return "YES"
}

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
}