Polycarp invited all his friends to the tea party to celebrate the holiday. He has n cups, one for each of his n friends, with volumes a1, a2, ..., an. His teapot stores w milliliters of tea (w ≤ a1 + a2 + ... + an). Polycarp wants to pour tea in cups in such a way that:  Every cup will contain tea for at least half of its volume  Every cup will contain integer number of milliliters of tea  All the tea from the teapot will be poured into cups  All friends will be satisfied. Friend with cup i won't be satisfied, if there exists such cup j that cup i contains less tea than cup j but ai > aj.For each cup output how many milliliters of tea should be poured in it. If it's impossible to pour all the tea and satisfy all conditions then output -1.

The first line contains two integer numbers n and w (1 ≤ n ≤ 100, ). The second line contains n numbers a1, a2, ..., an (1 ≤ ai ≤ 100).

Output how many milliliters of tea every cup should contain. If there are multiple answers, print any of them. If it's impossible to pour all the tea and satisfy all conditions then output -1.

NoteIn the third example you should pour to the first cup at least 5 milliliters, to the second one at least 4, to the third one at least 5. It sums up to 14, which is greater than 10 milliliters available.

package main

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

type fs struct {
	data  []int
	index []int
}

func (a *fs) Len() int {
	return len(a.data)
}

func (a *fs) Less(i, j int) bool {
	return a.data[a.index[i]] > a.data[a.index[j]]
}

func (a *fs) Swap(i, j int) {
	t := a.index[i]
	a.index[i] = a.index[j]
	a.index[j] = t
}

func main() {
	inp := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	is, err := inp.ReadString('\n')
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is = strings.TrimRight(is, "\n\r\t ")
	l1 := strings.Split(is, " ")
	if len(l1) != 2 {
		out.WriteString("-1")
		out.Flush()
		return
	}
	n, err := strconv.Atoi(l1[0])
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	w, err := strconv.Atoi(l1[1])
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is, err = inp.ReadString('\n')
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is = strings.TrimRight(is, "\n\r\t ")
	l2 := strings.Split(is, " ")
	if len(l2) != n {
		out.WriteString("-1")
		out.Flush()
		return
	}

	avol := make([]int, n)
	afact := make([]int, n)
	index := make([]int, n)
	for i := 0; i < n; i++ {
		avol[i], err = strconv.Atoi(l2[i])
		if err != nil {
			out.WriteString("-1")
			out.Flush()
			return
		}
		afact[i] = (avol[i] + 1) / 2
		w -= afact[i]
		if w < 0 {
			out.WriteString("-1")
			out.Flush()
			return
		}
		index[i] = i
	}

	//fmt.Printf("%v\n", afact)
	fss := fs{
		data:  avol,
		index: index,
	}
	sort.Sort(&fss)
	//fmt.Printf("%v\n", fss.index)

	for _, idx := range fss.index {
		add := avol[idx] - afact[idx]
		if w < add {
			add = w
		}
		afact[idx] += add
		w -= add
	}

	if w > 0 {
		out.WriteString("-1")
		out.Flush()
	} else {
		for _, v := range afact {
			out.WriteString(strconv.Itoa(v))
			out.WriteString(" ")
		}
	}
	out.Flush()
}

package main

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

type fs struct {
	data  []int
	index []int
}

func (a *fs) Len() int {
	return len(a.data)
}

func (a *fs) Less(i, j int) bool {
	return a.data[i] > a.data[j]
}

func (a *fs) Swap(i, j int) {
	t := a.index[i]
	a.index[i] = a.index[j]
	a.index[j] = t
}

func main() {
	inp := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	is, err := inp.ReadString('\n')
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is = strings.TrimRight(is, "\n\r\t ")
	l1 := strings.Split(is, " ")
	if len(l1) != 2 {
		out.WriteString("-1")
		out.Flush()
		return
	}
	n, err := strconv.Atoi(l1[0])
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	w, err := strconv.Atoi(l1[1])
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is, err = inp.ReadString('\n')
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is = strings.TrimRight(is, "\n\r\t ")
	l2 := strings.Split(is, " ")
	if len(l2) != n {
		out.WriteString("-1")
		out.Flush()
		return
	}

	avol := make([]int, n)
	afact := make([]int, n)
	index := make([]int, n)
	for i := 0; i < n; i++ {
		avol[i], err = strconv.Atoi(l2[i])
		if err != nil {
			out.WriteString("-1")
			out.Flush()
			return
		}
		afact[i] = (avol[i] + 1) / 2
		w -= afact[i]
		if w < 0 {
			out.WriteString("-1")
			out.Flush()
			return
		}
		index[i] = i
	}

	//fmt.Printf("%v\n", afact)
	fss := fs{
		data:  avol,
		index: index,
	}
	sort.Sort(&fss)
	//fmt.Printf("%v\n", fss.index)

	for _, idx := range fss.index {
		add := avol[idx] - afact[idx]
		if w < add {
			add = w
		}
		afact[idx] += add
		w -= add
	}

	if w > 0 {
		out.WriteString("-1")
		out.Flush()
	} else {
		for _, v := range afact {
			out.WriteString(strconv.Itoa(v))
			out.WriteString(" ")
		}
	}
	out.Flush()
}

package main

import (
	"bufio"
	//	"math"
	"os"
	"strconv"
	"strings"
)

func main() {
	inp := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	is, err := inp.ReadString('\n')
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is = strings.TrimRight(is, "\n\r\t ")
	l1 := strings.Split(is, " ")
	if len(l1) != 2 {
		out.WriteString("-1")
		out.Flush()
		return
	}
	n, err := strconv.Atoi(l1[0])
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	w, err := strconv.Atoi(l1[1])
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is, err = inp.ReadString('\n')
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is = strings.TrimRight(is, "\n\r\t ")
	l2 := strings.Split(is, " ")
	if len(l2) != n {
		out.WriteString("-1")
		out.Flush()
		return
	}
	avol := make([]int, n)
	afact := make([]int, n)
	minv := 0
	for i := 0; i < n; i++ {
		avol[i], err = strconv.Atoi(l2[i])
		if err != nil {
			out.WriteString("-1")
			out.Flush()
			return
		}
		cv := (avol[i] + 1) / 2
		if cv < minv {
			cv = minv
		} else {
			minv = cv
		}
		afact[i] = cv
		w -= cv
		if w <= 0 {
			out.WriteString("-1")
			out.Flush()
			return
		}
	}
	maxv := avol[n-1]
	for i := n - 1; i >= 0; i-- {
		add := 0
		if avol[i] > maxv {
			add = maxv - afact[i]
		} else {
			add = avol[i] - afact[i]
			maxv = avol[i]
		}
		if add < w {
			afact[i] += w
			break
		} else {
			afact[i] += add
			w -= add
		}
	}

	if w > 0 {
		out.WriteString("-1")
		out.Flush()
	} else {
		for _, v := range afact {
			out.WriteString(strconv.Itoa(v))
		}
	}
	out.Flush()
}

package main

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

type fs struct {
	data  []int
	index []int
}

func (a *fs) Len() int {
	return len(a.data)
}

func (a *fs) Less(i, j int) bool {
	return a.data[i] > a.data[j]
}

func (a *fs) Swap(i, j int) {
	t := a.index[i]
	a.index[i] = a.index[j]
	a.index[j] = t
}

func main() {
	inp := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	is, err := inp.ReadString('\n')
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is = strings.TrimRight(is, "\n\r\t ")
	l1 := strings.Split(is, " ")
	if len(l1) != 2 {
		out.WriteString("-1")
		out.Flush()
		return
	}
	n, err := strconv.Atoi(l1[0])
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	w, err := strconv.Atoi(l1[1])
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is, err = inp.ReadString('\n')
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is = strings.TrimRight(is, "\n\r\t ")
	l2 := strings.Split(is, " ")
	if len(l2) != n {
		out.WriteString("-1")
		out.Flush()
		return
	}

	avol := make([]int, n)
	afact := make([]int, n)
	index := make([]int, n)
	for i := 0; i < n; i++ {
		avol[i], err = strconv.Atoi(l2[i])
		if err != nil {
			out.WriteString("-1")
			out.Flush()
			return
		}
		afact[i] = (avol[i] + 1) / 2
		w -= afact[i]
		if w < 0 {
			out.WriteString("-1")
			out.Flush()
			return
		}
		index[i] = i
	}
	fss := fs{
		data:  avol,
		index: index,
	}
	sort.Sort(&fss)

	for _, idx := range fss.index {
		add := avol[idx] - afact[idx]
		if w < add {
			add = w
		}
		afact[idx] += w
		w -= add
	}

	if w > 0 {
		out.WriteString("-1")
		out.Flush()
	} else {
		for _, v := range afact {
			out.WriteString(strconv.Itoa(v))
			out.WriteString(" ")
		}
	}
	out.Flush()
}

package main

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

func main() {
	inp := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	is, err := inp.ReadString('\n')
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is = strings.TrimRight(is, "\n\r\t ")
	l1 := strings.Split(is, " ")
	if len(l1) != 2 {
		out.WriteString("-1")
		out.Flush()
		return
	}
	n, err := strconv.Atoi(l1[0])
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	w, err := strconv.Atoi(l1[1])
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is, err = inp.ReadString('\n')
	if err != nil {
		out.WriteString("-1")
		out.Flush()
		return
	}
	is = strings.TrimRight(is, "\n\r\t ")
	l2 := strings.Split(is, " ")
	if len(l2) != n {
		out.WriteString("-1")
		out.Flush()
		return
	}

	avol := make([]int, n)
	afact := make([]int, n)
	minv := 0
	for i := 0; i < n; i++ {
		avol[i], err = strconv.Atoi(l2[i])
		if err != nil {
			out.WriteString("-1")
			out.Flush()
			return
		}
		cv := (avol[i] + 1) / 2
		if cv < minv {
			cv = minv
		} else {
			minv = cv
		}
		afact[i] = cv
		w -= cv
		if w <= 0 {
			out.WriteString("-1")
			out.Flush()
			return
		}
	}
	maxv := avol[n-1]
	for i := n - 1; i >= 0; i-- {
		add := 0
		if avol[i] > maxv {
			add = maxv - afact[i]
		} else {
			add = avol[i] - afact[i]
			maxv = avol[i]
		}
		if add >= w {
			afact[i] += w
			w = 0
			break
		} else {
			afact[i] += add
			w -= add
		}
		fmt.Println(i, avol[i], afact[i], w)
	}

	if w > 0 {
		out.WriteString("-1")
		out.Flush()
	} else {
		for _, v := range afact {
			out.WriteString(strconv.Itoa(v))
			out.WriteString(" ")
		}
	}
	out.Flush()
}


Year 2118. Androids are in mass production for decades now, and they do all the work for humans. But androids have to go to school to be able to solve creative tasks. Just like humans before.It turns out that high school struggles are not gone. If someone is not like others, he is bullied. Vasya-8800 is an economy-class android which is produced by a little-known company. His design is not perfect, his characteristics also could be better. So he is bullied by other androids.One of the popular pranks on Vasya is to force him to compare $$$x^y$$$ with $$$y^x$$$. Other androids can do it in milliseconds while Vasya's memory is too small to store such big numbers.Please help Vasya! Write a fast program to compare $$$x^y$$$ with $$$y^x$$$ for Vasya, maybe then other androids will respect him.

On the only line of input there are two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 10^{9}$$$).

If $$$x^y < y^x$$$, then print '<' (without quotes). If $$$x^y > y^x$$$, then print '>' (without quotes). If $$$x^y = y^x$$$, then print '=' (without quotes).

NoteIn the first example $$$5^8 = 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 = 390625$$$, and $$$8^5 = 8 \cdot 8 \cdot 8 \cdot 8 \cdot 8 = 32768$$$. So you should print '>'.In the second example $$$10^3 = 1000 < 3^{10} = 59049$$$.In the third example $$$6^6 = 46656 = 6^6$$$.

package main
import (
	"fmt"
	"math"
	"os"
)

func main(){
	var a, b float64
	fmt.Scan(&a)
	fmt.Scan(&b)
	if a == b {
		fmt.Println("=")
		os.Exit(0)
	}
	if a > b {
		var x, y float64
		x = b
		y = a
		x = (x * math.Log(a)) / math.Log(b)
		if x == y {
			fmt.Println("=")
		} else if x > y {
			fmt.Println(">")
		} else{
			fmt.Println("<")
		}
	} else {
		var x, y float64
		x = b
		y = a
		y = (y * math.Log(b)) / math.Log(a)
		if x == y {
			fmt.Println("=")
		} else if x > y {
			fmt.Println(">")
		} else{
			fmt.Println("<")
		}
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var x, y float64
	fmt.Fscan(reader, &x, &y)
	x, y = y*math.Log(x), x*math.Log(y)
	// fmt.Println(x, y)
	if x == y {
		fmt.Println("=")
		return
	} else if x > y {
		fmt.Println(">")
	} else if x < y {
		fmt.Println("<")
	}
}

package main

import (
	"bufio"
	"fmt"
	"strconv"
	"math"
)

func main() {
	var x1,y1 float64
	fmt.Scanf("%f %f\n", &x1, &y1)
	x := (math.Log(x1)*y1)
	y := (math.Log(y1)*x1)
	if x == y {
		fmt.Println("=")
	} else if x > y {
		fmt.Println(">")
	} else {
		fmt.Println("<")
	}
}

func readOneInt64(r *bufio.Reader) (n int64) {
	bytes, _ := r.ReadBytes('\n')
	n, _ = strconv.ParseInt(string(bytes[:len(bytes)-2]), 10, 64)
	return
}

func readInt64Slice(r *bufio.Reader, n int) (slice []int64) {
	var bytes []byte
	slice = make([]int64, n)
	n--
	for i := 0; i < n; i++ {
		bytes, _ = r.ReadBytes(' ')
		slice[i], _ = strconv.ParseInt(string(bytes[:len(bytes)-1]), 10, 64)
	}
	slice[n] = readOneInt64(r)
	return
}

func readOneString(r *bufio.Reader) string {
	bytes, _ := r.ReadBytes('\n')
	return string(bytes[:len(bytes)-2])
}

func abs(i int) int {
	if i < 0 {
		return i * -1
	}
	return i
}

package main

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

var sc = bufio.NewScanner(os.Stdin)
const EPS = 0.00000001

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

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main(){
	sc.Split(bufio.ScanWords)

	x := float64(nextInt())
	y := float64(nextInt())

	res_xy := y * math.Log2(x)
	res_yx := x * math.Log2(y)

	//fmt.Printf("%v, %v, %v", res_xy, res_yx, res_xy-res_yx)

	if math.Abs(res_xy - res_yx) < EPS{
		fmt.Println("=")
	}else if res_xy < res_yx {
		fmt.Println("<")
	}else {
		fmt.Println(">")
	}
}

package main

import (
	"fmt"
)

func main() {
	var x, y int
	fmt.Scanf("%d %d\n", &x, &y)
	if x == y {
		fmt.Println("=")
		return
	}
	if x > y {
		if y >= 3 {
			fmt.Println("<")
			return
		}
		if y == 2 {
			if x == 4 {
				fmt.Println("=")
				return
			}
			if x == 3 {
				fmt.Println(">")
				return
			}
			if x > 4 {
				fmt.Println("<")
				return
			}
		}
		if y == 1 {
			fmt.Println(">")
		}
	}
	if x < y {
		if x >= 3 {
			fmt.Println(">")
			return
		}
		if x == 2 {
			if y == 4 {
				fmt.Println("=")
				return
			}
			if y == 3 {
				fmt.Println("<")
				return
			}
			if y > 4 {
				fmt.Println(">")
				return
			}
		}
		if x == 1 {
			fmt.Println("<")
		}
	}
}

package main

import (
	"math"
	"fmt"
)

func main () {
	var a float64
	var b float64

	fmt.Scanf("%f %f\n",&a,&b)

	c := b * math.Log(a)
	d := a * math.Log(b)

	if c < d {
		fmt.Println("<")
	} else if c > d {
		fmt.Println(">")
	} else {
		fmt.Println("=")
	}

}

package main

/*
	The idea to solve this problem is by using logarithm to solve
	the equation. We apply logarithm to both sides of equation then
	compare them. For details take a look at this reference:
	http://www.montereyinstitute.org/courses/DevelopmentalMath/COURSE_TEXT2_RESOURCE/U18_L4_T1_text_final.html
*/

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

func main() {
	var x, y float64
	stdin := bufio.NewReader(os.Stdin)
	fmt.Fscanf(stdin, "%f %f\n", &x, &y)
	x, y = y*math.Log(x), x*math.Log(y)
	if x == y {
		fmt.Println("=")
	} else if x < y {
		fmt.Println("<")
	} else {
		fmt.Println(">")
	}
}

package main

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

func main() {
	var x, y float64
	stdin := bufio.NewReader(os.Stdin)
	fmt.Fscanf(stdin, "%f %f\n", &x, &y)
	x, y = y*math.Log(x), x*math.Log(y)
	if x == y {
		fmt.Println("=")
	} else if x < y {
		fmt.Println("<")
	} else {
		fmt.Println(">")
	}
}

package main

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

func solve() {
	x := float64(readInt())
	y := float64(readInt())
	t0 := y * math.Log(x)
	t1 := x * math.Log(y)
	if t0 == t1 {
		fmt.Println("=")
	} else if t1 < t0 {
		fmt.Println(">")
	} else {
		fmt.Println("<")
	}
}

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

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

var scanner *bufio.Scanner

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var a, b float64
	fmt.Scan(&a, &b)

	var t float64 = math.Log2(a) / math.Log2(b) * b
	if a == b {
		fmt.Println("=")
	} else if t == a {
		fmt.Println("=")
	} else if t > a {
		fmt.Println(">")
	} else {
		fmt.Println("<")
	}
}

package main
import (
	"fmt"
	"math"
	"os"
)

func main(){
	var a, b float64
	fmt.Scan(&a)
	fmt.Scan(&b)
	if a == b {
		fmt.Println("=")
		os.Exit(0)
	}
	if a > b {
		var x, y float64
		x = b
		y = a
		x = (x * math.Log(a)) / math.Log(b)
		if x > y {
			fmt.Println(">")
		} else{
			fmt.Println("<")
		}
	} else {
		var x, y float64
		x = b
		y = a
		y = (y * math.Log(b)) / math.Log(a)
		if x > y {
			fmt.Println(">")
		} else{
			fmt.Println("<")
		}
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var x, y int
	fmt.Fscan(reader, &x, &y)
	xLog, yLog := int(math.Log(float64(x))), int(math.Log(float64(x)))
	if y*xLog == yLog*x {
		fmt.Println("=")
		return
	} else if y*xLog > yLog*x {
		fmt.Println(">")
	} else if y*xLog < yLog*x {
		fmt.Println("<")
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var x, y int
	fmt.Fscan(reader, &x, &y)

	if x == y {
		fmt.Println("=")
		return
	} else if x > y {
		fmt.Println("<")
	} else if x < y {
		fmt.Println(">")
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var x, y int
	fmt.Fscan(reader, &x, &y)
	xLog, yLog := int(math.Log(float64(x))), int(math.Log(float64(y)))
	// fmt.Println(xLog, yLog)
	if y*xLog == yLog*x {
		fmt.Println("=")
		return
	} else if y*xLog > yLog*x {
		fmt.Println(">")
	} else if y*xLog < yLog*x {
		fmt.Println("<")
	}
}

package main

import (
	"fmt"
)

func main() {
	var x, y int
	fmt.Scanf("%d", &x)
	fmt.Scanf("%d", &y)

	if x == y {
		fmt.Print("=")
		return
	}
	if x > y {
		if y >= 3 {
			fmt.Print("<")
			return
		}
		fmt.Print(">")
		return
	}
	if x < y {
		if x >= 3 {
			fmt.Print(">")
			return
		}
		fmt.Print("<")
		return
	}
}

package main

import (
	"fmt"
)

func main() {
	var x, y int
	fmt.Scanf("%d %d\n", &x, &y)
	if x == y {
		fmt.Println("=")
		return
	}
	if x > y {
		if y >= 3 {
			fmt.Println("<")
			return
		}
		fmt.Println(">")
		return
	}
	if x < y {
		if x >= 3 {
			fmt.Println(">")
			return
		}
		fmt.Println("<")
		return
	}
}

package main

import (
	"fmt"
)

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

	if x == y {
		fmt.Print("=")
		return
	}
	if x > y {
		if y >= 3 {
			fmt.Print("<")
			return
		}
		fmt.Print(">")
		return
	}
	if x < y {
		if x >= 3 {
			fmt.Print(">")
			return
		}
		fmt.Print("<")
		return
	}
}

package main

import (
	"fmt"
)

func main() {
	var x, y int
	fmt.Scanf("%d %d\n", &x, &y)
	if x == y {
		fmt.Println("=")
		return
	}
	if x > y {
		if y >= 3 {
			fmt.Println("<")
			return
		}
		if y == 2 {
			if x == 4 {
				fmt.Println("=")
				return
			}
			if x == 3 {
				fmt.Println(">")
				return
			}
			if x > 4 {
				fmt.Println("<")
				return
			}
		}
	}
	if x < y {
		if x >= 3 {
			fmt.Println(">")
			return
		}
		if x == 2 {
			if y == 4 {
				fmt.Println("=")
				return
			}
			if y == 3 {
				fmt.Println("<")
				return
			}
			if y > 4 {
				fmt.Println(">")
				return
			}
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var x, y int
	fmt.Scanf("%d %d", &x, &y)

	if x == y {
		fmt.Println("=")
		return
	}
	if x > y {
		if y >= 3 {
			fmt.Println("<")
			return
		}
		fmt.Println(">")
	}
	if x < y {
		if x >= 3 {
			fmt.Println(">")
			return
		}
		fmt.Println("<")
	}
}

package main

import (
	"fmt"
)

func main() {
	var x, y int
	fmt.Scanf("%d %d\n", &x, &y)
	if x == y {
		fmt.Println("=")
		return
	}
	if x > y {
		if y >= 3 {
			fmt.Println("<")
			return
		}
		if y == 2 {
			if x == 4 {
				fmt.Println("=")
				return
			}
			if x == 3 {
				fmt.Println(">")
				return
			}
			if x > 4 {
				fmt.Println("<")
				return
			}
		}
		if y == 1 {
			fmt.Println(">")
		}
	}
	if x < y {
		if x >= 3 {
			fmt.Println(">")
			return
		}
		if x == 2 {
			if y == 4 {
				fmt.Println("=")
				return
			}
			if y == 3 {
				fmt.Println("<")
				return
			}
			if y > 4 {
				fmt.Println(">")
				return
			}
		}
		if y == 1 {
			fmt.Println("<")
		}
	}
}

package main

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

func solve() {
	x := readInt()
	y := readInt()
	if y == x {
		fmt.Println("=")
	} else if x == 1 {
		fmt.Println("<")
	} else if y == 1 {
		fmt.Println(">")
	} else if x == 2 {
		fmt.Println("<")
	} else if y == 2 {
		fmt.Println(">")
	} else if x > y {
		fmt.Println("<")
	} else {
		fmt.Println(">")
	}
}

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

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

var scanner *bufio.Scanner

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

package main

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

func solve() {
	x := readInt()
	y := readInt()
	if y == x {
		fmt.Println("=")
	} else if x == 1 {
		fmt.Println("<")
	} else if y == 1 {
		fmt.Println(">")
	} else if x == 2 {
		fmt.Println("<")
	} else if y == 2 {
		fmt.Println(">")
	} else if int64(x)*int64(x) > int64(y)*int64(y) {
		fmt.Println("<")
	} else {
		fmt.Println(">")
	}
}

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

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

var scanner *bufio.Scanner

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

package main

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

func solve() {
	x := readInt()
	y := readInt()
	if y == x {
		fmt.Println("=")
		return
	}
	if y%x == 0 && y/x == x {
		fmt.Println("=")
		return
	}
	if x%y == 0 && x/y == y {
		fmt.Println("=")
		return
	}
	if x == 1 {
		fmt.Println("<")
	} else if y == 1 {
		fmt.Println(">")
	} else if x == 2 {
		fmt.Println("<")
	} else if y == 2 {
		fmt.Println(">")
	} else if int64(x)*int64(x) > int64(y)*int64(y) {
		//		2 * 2 * 2 * 2
		//
		//		4 * 4
		fmt.Println("<")
	} else {
		fmt.Println(">")
	}
}

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

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

var scanner *bufio.Scanner

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

package main

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

func solve() {
	x := readInt()
	y := readInt()
	if y == x {
		fmt.Println("=")
	} else if y < x {
		fmt.Println("<")
	} else {
		fmt.Println(">")
	}
}

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

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

var scanner *bufio.Scanner

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}


You are given three integers $$$a$$$, $$$b$$$ and $$$x$$$. Your task is to construct a binary string $$$s$$$ of length $$$n = a + b$$$ such that there are exactly $$$a$$$ zeroes, exactly $$$b$$$ ones and exactly $$$x$$$ indices $$$i$$$ (where $$$1 \le i < n$$$) such that $$$s_i \ne s_{i + 1}$$$. It is guaranteed that the answer always exists.For example, for the string "01010" there are four indices $$$i$$$ such that $$$1 \le i < n$$$ and $$$s_i \ne s_{i + 1}$$$ ($$$i = 1, 2, 3, 4$$$). For the string "111001" there are two such indices $$$i$$$ ($$$i = 3, 5$$$).Recall that binary string is a non-empty sequence of characters where each character is either 0 or 1.

The first line of the input contains three integers $$$a$$$, $$$b$$$ and $$$x$$$ ($$$1 \le a, b \le 100, 1 \le x < a + b)$$$.

Print only one string $$$s$$$, where $$$s$$$ is any binary string satisfying conditions described above. It is guaranteed that the answer always exists.

NoteAll possible answers for the first example:   1100;  0011. All possible answers for the second example:   110100;  101100;  110010;  100110;  011001;  001101;  010011;  001011.

package main

import (
    "fmt"
)

func main() {
    // initialize
    var a, b, x int
    var a_byte, b_byte byte = '0', '1'

    // read input
    fmt.Scan(&a, &b, &x)

    if a < b {
        a, b = b, a
        a_byte, b_byte = b_byte, a_byte
    }

    // print answer
    fmt.Printf("%c", a_byte)
    a -= 1

    for x > 1 {
        fmt.Printf("%c", b_byte)
        b -= 1

        a, b = b, a
        a_byte, b_byte = b_byte, a_byte

        x -= 1
    }

    // finish it
    for a > 0 {
        fmt.Printf("%c", a_byte)
        a -= 1
    }
    for (b > 0) {
        fmt.Printf("%c", b_byte)
        b -= 1
    }

    fmt.Println()
}

package main

import (
	. "fmt"
	. "strings"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	var a, b, x int
	Scan(&a, &b, &x)
	k := (x + 1) / 2
	a -= k
	b -= k
	R := Repeat
	s := R("01", k)
	if x&1 > 0 {
		s = R("0", a) + s + R("1", b)
	} else if a > 0 {
		s += R("1", b) + R("0", a)
	} else {
		s = R("1", b) + s
	}
	Print(s)
}

package main

import "fmt"

func main() {
	var a, b, x int
	fmt.Scan(&a, &b, &x)
	x++
	if a > b {
		for ; x > 2; {
				fmt.Printf("01")
				x -= 2
				a--
				b--
				continue
		}
		if x == 2 {
			for ; a > 0 || b > 0 ; {
				if a != 0 {
					fmt.Printf("0")
					a--
					continue
				}
				if b != 0 {
					fmt.Printf("1")
					b--
					continue
				}
			}
		} else {
			for ; a > 0 || b > 0 ; {
				if b != 0 {
					fmt.Printf("1")
					b--
					continue
				}
				if a != 0 {
					fmt.Printf("0")
					a--
					continue
				}
			}
		}
	} else {
		for ; x > 2; {
			fmt.Printf("10")
			x -= 2
			a--
			b--
			continue
		}
		if x == 2 {
			for ; a > 0 || b > 0; {
				if b != 0 {
					fmt.Printf("1")
					b--
					continue
				}
				if a != 0 {
					fmt.Printf("0")
					a--
					continue
				}
			}
		} else {
			for ; a > 0 || b > 0; {
				if a != 0 {
					fmt.Printf("0")
					a--
					continue
				}
				if b != 0 {
					fmt.Printf("1")
					b--
					continue
				}
			}
		}
	}
}

package main

import (
	. "fmt"
	. "strings"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	var a, b, x int
	Scan(&a, &b, &x)
	k := (x + 1) / 2
	a -= k
	b -= k
	R := Repeat
	s := R("01", k)
	if x&1 > 0 {
		s = R("0", a) + s + R("1", b)
	} else {
		s += R("1", b) + R("0", a)
	}
	Print(s)
}

package main

import "fmt"

func main() {
	var a, b, x int
	fmt.Scan(&a, &b, &x)
	if a > b {
		for ; a > 0 || b > 0; {
			if x > 1 {
				fmt.Printf("10")
				x -= 2
				a--
				b--
				continue
			}
			if a != 0 {
				fmt.Printf("1")
				a--
				continue
			}
			if b != 0 {
				fmt.Printf("0")
				b--
				continue
			}
		}
	} else {
		for ; a > 0 || b > 0; {
			if x > 1 {
				fmt.Printf("01")
				x -= 2
				a--
				b--
				continue
			}
			if b != 0 {
				fmt.Printf("0")
				b--
				continue
			}
			if a != 0 {
				fmt.Printf("1")
				a--
				continue
			}

		}
	}
}

package main

import "fmt"

func main() {
	var a, b, x int
	fmt.Scan(&a, &b, &x)
	if a > b {
		for ; a > 0 || b > 0; {
			if x > 1 {
				fmt.Printf("01")
				x -= 2
				a--
				b--
				continue
			}
			if b != 0 {
				fmt.Printf("1")
				b--
				continue
			}
			if a != 0 {
				fmt.Printf("0")
				a--
				continue
			}
		}
	} else {
		for ; a > 0 || b > 0; {
			if x > 1 {
				fmt.Printf("10")
				x -= 2
				a--
				b--
				continue
			}
			if a != 0 {
				fmt.Printf("0")
				a--
				continue
			}
			if b != 0 {
				fmt.Printf("1")
				b--
				continue
			}
		}
	}
}

package main

import "fmt"

func main() {
	var a, b, x int
	fmt.Scan(&a, &b, &x)
	if a > b {
		for ; a > 0 || b > 0; {
			if x > 1 {
				fmt.Printf("01")
				x -= 2
				a--
				b--
				continue
			}
			if a != 0 {
				fmt.Printf("0")
				a--
				continue
			}
			if b != 0 {
				fmt.Printf("1")
				b--
				continue
			}
		}
	} else {
		for ; a > 0 || b > 0; {
			if x > 1 {
				fmt.Printf("10")
				x -= 2
				a--
				b--
				continue
			}
			if b != 0 {
				fmt.Printf("1")
				b--
				continue
			}
			if a != 0 {
				fmt.Printf("0")
				a--
				continue
			}

		}
	}
}


You are given an integer $$$n$$$ from $$$1$$$ to $$$10^{18}$$$ without leading zeroes.In one move you can swap any two adjacent digits in the given number in such a way that the resulting number will not contain leading zeroes. In other words, after each move the number you have cannot contain any leading zeroes.What is the minimum number of moves you have to make to obtain a number that is divisible by $$$25$$$? Print -1 if it is impossible to obtain a number that is divisible by $$$25$$$.

The first line contains an integer $$$n$$$ ($$$1 \le n \le 10^{18}$$$). It is guaranteed that the first (left) digit of the number $$$n$$$ is not a zero.

If it is impossible to obtain a number that is divisible by $$$25$$$, print -1. Otherwise print the minimum number of moves required to obtain such number. Note that you can swap only adjacent digits in the given number.

NoteIn the first example one of the possible sequences of moves is 5071 $$$\rightarrow$$$ 5701 $$$\rightarrow$$$ 7501 $$$\rightarrow$$$ 7510 $$$\rightarrow$$$ 7150.

package main

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

// github.com/EndlessCheng/codeforces-go
func CF988E(in io.Reader, out io.Writer) {
	var s []byte
	Fscan(in, &s)
	n, ans := len(s), 99
	if n < 2 {
		Fprint(out, -1)
		return
	}
	for i := range s {
		for j := range s {
			if i == j {
				continue
			}
			t := make([]byte, n)
			copy(t, s)
			c := 0
			for k := i; k < n-1; k++ {
				t[k], t[k+1] = t[k+1], t[k]
				c++
			}
			k := j
			if j > i {
				k--
			}
			for ; k < n-2; k++ {
				t[k], t[k+1] = t[k+1], t[k]
				c++
			}
			for k = 0; t[k] == '0'; k++ {
			}
			for ; k > 0; k-- {
				t[k], t[k-1] = t[k-1], t[k]
				c++
			}
			if v, _ := strconv.Atoi(string(t[n-2:])); c < ans && v%25 == 0 {
				ans = c
			}
		}
	}
	if ans == 99 {
		ans = -1
	}
	Fprint(out, ans)
}

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

package main

import (
	. "fmt"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	var s []byte
	Scan(&s)
	n, ans := len(s), 99
	if n < 2 {
		Print(-1)
		return
	}
	for i := range s {
		for j := range s {
			if i == j {
				continue
			}
			t := make([]byte, n)
			copy(t, s)
			c := 0
			for k := i; k < n-1; k++ {
				t[k], t[k+1] = t[k+1], t[k]
				c++
			}
			k := j
			if j > i {
				k--
			}
			for ; k < n-2; k++ {
				t[k], t[k+1] = t[k+1], t[k]
				c++
			}
			for k = 0; t[k] == '0'; k++ {
			}
			for ; k > 0; k-- {
				t[k], t[k-1] = t[k-1], t[k]
				c++
			}
			if c < ans && (t[n-2]&15*10+t[n-1]&15)%25 == 0 {
				ans = c
			}
		}
	}
	if ans == 99 {
		ans = -1
	}
	Print(ans)
}

package main

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

const (
	INF = 12345
)

func Init() {
}

func Solve(io *FastIO) {
	S := io.NextLine()

	A := []rune(S)
	N := len(A)

	best := INF
	for i := 0; i < N; i++ {
		for j := i + 1; j < N; j++ {
			if (A[i] == '0' && A[j] == '0') || (A[i] == '2' && A[j] == '5') || (A[i] == '5' && A[j] == '0') || (A[i] == '7' && A[j] == '5') {
				best = Min(best, simulate(A, i, j))
			}
			if (A[i] == '5' && A[j] == '2') || (A[i] == '0' && A[j] == '5') || (A[i] == '5' && A[j] == '7') {
				best = Min(best, simulate(A, j, i))
			}
		}
	}
	if best < INF {
		io.Println(best)
	} else {
		io.Println(-1)
	}
}

func simulate(A []rune, front, back int) int {
	N := len(A)

	X := make([]rune, N)
	copy(X, A)

	if back < front {
		front--
	}

	a := swapTo(X, back, N - 1)
	b := swapTo(X, front, N - 2)
	c := fix(X)

	// fmt.Printf("A = %v, front = %d, back = %d, a = %d, b = %d, c = %d\n", A, front, back, a, b, c)

	return a + b + c
}

func swapTo(A []rune, i, j int) int {
	cnt := 0
	for i + 1 <= j {
		A[i], A[i + 1] = A[i + 1], A[i]
		cnt++
		i++
	}
	return cnt
}

func fix(A []rune) int {
	if A[0] != '0' {
		return 0
	}
	for i := 1; i < len(A) - 2; i++ {
		if A[i] != '0' {
			return i
		}
	}
	return INF
}

func Min(args ...int) int {
	min := args[0]
	for i := 1; i < len(args); i++ {
		if args[i] < min {
			min = args[i]
		}
	}
	return min
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

func IsLineBreakChar(c byte) bool {
	switch c {
		case 0, '\n', '\r':
			return true
		default:
			return false
	}
}

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}

package main

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

const (
	INF = 12345
)

func Init() {
}

func Solve(io *FastIO) {
	S := io.NextLine()

	A := []rune(S)
	N := len(A)

	best := INF
	for i := 0; i < N; i++ {
		for j := i + 1; j < N; j++ {
			if (A[i] == '0' && A[j] == '0') || (A[i] == '2' && A[j] == '5') || (A[i] == '5' && A[j] == '0') || (A[i] == '7' && A[j] == '5') {
				best = Min(best, simulate(A, i, j))
			}
			if (A[i] == '5' && A[j] == '2') || (A[i] == '0' && A[j] == '5') || (A[i] == '5' && A[j] == '7') {
				best = Min(best, simulate(A, j, i))
			}
		}
	}
	if best < INF {
		io.Println(best)
	} else {
		io.Println(-1)
	}
}

func simulate(A []rune, front, back int) int {
	N := len(A)

	X := make([]rune, N)
	copy(X, A)

	if back < front {
		front--
	}

	a := swapTo(X, back, N - 1)
	b := swapTo(X, front, N - 2)
	c := fix(X)

	return a + b + c
}

func swapTo(A []rune, i, j int) int {
	cnt := 0
	for i + 1 <= j {
		A[i], A[i + 1] = A[i + 1], A[i]
		cnt++
		i++
	}
	return cnt
}

func fix(A []rune) int {
	if A[0] != '0' {
		return 0
	}
	for i := 1; i < len(A) - 2; i++ {
		if A[i] != '0' {
			return i
		}
	}
	return INF
}

func Min(args ...int) int {
	min := args[0]
	for i := 1; i < len(args); i++ {
		if args[i] < min {
			min = args[i]
		}
	}
	return min
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

func IsLineBreakChar(c byte) bool {
	switch c {
		case 0, '\n', '\r':
			return true
		default:
			return false
	}
}

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}

package main

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

const (
	INF = 12345
)

func Init() {
}

func Solve(io *FastIO) {
	S := io.NextLine()

	A := []rune(S)
	N := len(A)

	best := INF
	for i := 0; i < N; i++ {
		for j := i + 1; j < N; j++ {
			if (A[i] == '0' && A[j] == '0') || (A[i] == '2' && A[j] == '5') || (A[i] == '5' && A[j] == '0') || (A[i] == '7' && A[j] == '5') {
				best = Min(best, simulate(A, i, j))
			}
			if (A[i] == '5' && A[j] == '2') || (A[i] == '0' && A[j] == '5') || (A[i] == '5' && A[j] == '7') {
				best = Min(best, simulate(A, i, j))
			}
		}
	}
	if best < INF {
		io.Println(best)
	} else {
		io.Println(-1)
	}
}

func simulate(A []rune, front, back int) int {
	N := len(A)

	X := make([]rune, N)
	copy(A, X)

	if back < front {
		front--
	}

	a := swapTo(X, back, N - 1)
	b := swapTo(X, front, N - 2)
	c := fix(X)

	return a + b + c
}

func swapTo(A []rune, i, j int) int {
	cnt := 0
	for i + 1 <= j {
		A[i], A[i + 1] = A[i + 1], A[i]
		cnt++
		i++
	}
	return cnt
}

func fix(A []rune) int {
	if A[0] != '0' {
		return 0
	}
	for i := 1; i < len(A) - 2; i++ {
		if A[i] != '0' {
			return i
		}
	}
	return INF
}

func Min(args ...int) int {
	min := args[0]
	for i := 1; i < len(args); i++ {
		if args[i] < min {
			min = args[i]
		}
	}
	return min
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

func IsLineBreakChar(c byte) bool {
	switch c {
		case 0, '\n', '\r':
			return true
		default:
			return false
	}
}

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}

package main

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

const (
	INF = 12345
)

func Init() {
}

func Solve(io *FastIO) {
	S := io.NextLine()

	A := []rune(S)
	N := len(A)

	best := INF
	for i := 0; i < N; i++ {
		for j := i + 1; j < N; j++ {
			if (A[i] == '0' && A[j] == '0') || (A[i] == '2' && A[j] == '5') || (A[i] == '5' && A[j] == '0') || (A[i] == '7' && A[j] == '5') {
				best = Min(best, simulate(A, i, j))
			}
			if (A[i] == '5' && A[j] == '2') || (A[i] == '0' && A[j] == '5') || (A[i] == '5' && A[j] == '7') {
				best = Min(best, simulate(A, i, j))
			}
		}
	}
	if best < INF {
		io.Println(best)
	} else {
		io.Println(-1)
	}
}

func simulate(A []rune, front, back int) int {
	N := len(A)

	X := make([]rune, N)
	copy(X, A)

	if back < front {
		front--
	}

	a := swapTo(X, back, N - 1)
	b := swapTo(X, front, N - 2)
	c := fix(X)

	return a + b + c
}

func swapTo(A []rune, i, j int) int {
	cnt := 0
	for i + 1 <= j {
		A[i], A[i + 1] = A[i + 1], A[i]
		cnt++
		i++
	}
	return cnt
}

func fix(A []rune) int {
	if A[0] != '0' {
		return 0
	}
	for i := 1; i < len(A) - 2; i++ {
		if A[i] != '0' {
			return i
		}
	}
	return INF
}

func Min(args ...int) int {
	min := args[0]
	for i := 1; i < len(args); i++ {
		if args[i] < min {
			min = args[i]
		}
	}
	return min
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

func IsLineBreakChar(c byte) bool {
	switch c {
		case 0, '\n', '\r':
			return true
		default:
			return false
	}
}

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}


Pasha has a wooden stick of some positive integer length n. He wants to perform exactly three cuts to get four parts of the stick. Each part must have some positive integer length and the sum of these lengths will obviously be n. Pasha likes rectangles but hates squares, so he wonders, how many ways are there to split a stick into four parts so that it's possible to form a rectangle using these parts, but is impossible to form a square.Your task is to help Pasha and count the number of such ways. Two ways to cut the stick are considered distinct if there exists some integer x, such that the number of parts of length x in the first way differ from the number of parts of length x in the second way.

The first line of the input contains a positive integer n (1 ≤ n ≤ 2·109) — the length of Pasha's stick.

The output should contain a single integer — the number of ways to split Pasha's stick into four parts of positive integer length so that it's possible to make a rectangle by connecting the ends of these parts, but is impossible to form a square.

NoteThere is only one way to divide the stick in the first sample {1, 1, 2, 2}.Four ways to divide the stick in the second sample are {1, 1, 9, 9}, {2, 2, 8, 8}, {3, 3, 7, 7} and {4, 4, 6, 6}. Note that {5, 5, 5, 5} doesn't work.

// stick.go
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	c := 0
	if n%2 == 0 {
		c = int((n - 1) / 4)
	}
	fmt.Println(c)
}

package main

import "fmt"

func solve(n int64) int64 {
    if n%2 != 0 {
        return 0
    }
    if n < 6 {
        return 0
    }
    if n == 6 {
        return 1
    }
    if n%4 == 0 {
        return n/4 - 1
    }
    return n/4
}

func main() {
    var n int64
    fmt.Scanf("%d", &n)
    fmt.Println(solve(n))
}

package main

import 	"fmt"

func main() {
	var n int
	fmt.Scan(&n)
	a := 0
	if n%2 == 0 {
		a = int((n - 1) / 4)
	}
	fmt.Println(a)
}

package main

import "fmt"
import "math"

var n float64

func main() {
        fmt.Scanln(&n)
        if int(n)%2 != 0 {
                fmt.Println(0)
                return
        }
        ans := int(math.Ceil(((n / 2) / 2)))
        ans -= 1
        fmt.Println(ans)
}

package main

import (
	"fmt"
)

func main() {
	var n, o int
	fmt.Scanln(&n)
	if n%2 != 0 {
		o = 0
	} else {
		if n%4 == 0 {
			o = n/4 - 1
		} else {
			o = n / 4
		}
	}
	fmt.Println(o)
}

package main

import "fmt"

func solve(n int64) int64 {
    if n < 6 {
        return 0
    }
    if n == 6 {
        return 1
    }
    if n%4 == 0 {
        return n/4 - 1
    }
    return n/4
}

func main() {
    var n int64
    fmt.Scanf("%d", &n)
    fmt.Println(solve(n))
}

package main

import "fmt"

func solve(n int64) int64 {
    if n < 6 {
        return 0
    }
    if n == 6 {
        return 1
    }
    if n%4 == 0 {
        return n/4 - 1
    }
    return n/4 - 1
}

func main() {
    var n int64
    fmt.Scanf("%d", &n)
    fmt.Println(solve(n))
}

package main

import "fmt"
import "math"

var n float64

func main() {
        fmt.Scanln(&n)
        if int(n)%2 == 0 {
                fmt.Println(0)
                return
        }
        ans := int(math.Ceil(((n / 2) / 2)))
        ans -= 1
        fmt.Println(ans)
}

package main

import (
	"fmt"
)

func main() {
	var n, o int
	fmt.Scanln(&n)
	if n%4 == 0 {
		o = n/4 - 1
	} else {
		o = n / 4
	}
	fmt.Println(o)
}


Vanya got an important task — he should enumerate books in the library and label each book with its number. Each of the n books should be assigned with a number from 1 to n. Naturally, distinct books should be assigned distinct numbers.Vanya wants to know how many digits he will have to write down as he labels the books.

The first line contains integer n (1 ≤ n ≤ 109) — the number of books in the library.

Print the number of digits needed to number all the books.

NoteNote to the first test. The books get numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, which totals to 17 digits.Note to the second sample. The books get numbers 1, 2, 3, 4, which totals to 4 digits.

package main

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

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

//Wrong
func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	n := nextInt64()
	var cnt, num, minus, length, base int64

	num = n
	base = 1
	length = 1

	for num >= 10 {
		minus += 9 * base
		cnt += 9 * base * length
		num /= 10
		base *= 10
		length++
	}

	cnt += (n - minus) * length

	println(cnt)
}

func scan(a ...interface{}) {
	fmt.Fscan(reader, a...)
}

func next() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func nextInt64() int64 {
	n, _ := strconv.ParseInt(next(), 0, 64)
	return n
}

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

func nextFloat() float64 {
	n, _ := strconv.ParseFloat(next(), 64)
	return n
}

func println(a ...interface{})               { fmt.Fprintln(writer, a...) }
func print(a ...interface{})                 { fmt.Fprint(writer, a...) }
func printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }

package main

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

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

func count(n int64) int64 {
	if n < 10 {
		return int64(n)
	}
	var l, p int64 = 1, 1
	for p * 10 <= n {
		l++
		p *= 10
	}

	return l * ((n / p - 1) * p + (n % p + 1)) + count(p - 1)
}

func main() {

	defer out.Flush()
	in.Split(bufio.ScanWords)

	fmt.Fprintln(out, count(NextInt64()))
}

func Next() string{
	if !in.Scan() {
		panic("Scan error")
	}
	return in.Text()
}

func NextInt() int{
	ret, _ := strconv.Atoi(Next())
	return ret
}

func NextInt64() int64 {
	ret, _ := strconv.ParseInt(Next(), 10, 64)
	return ret
}

package main

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

func main() {
    //io
    scanner := bufio.NewReader(os.Stdin)
    writer := bufio.NewWriter(os.Stdout)
    //---
    var n, d, c, ans int64

    fmt.Fscan(scanner, &n)
    for c = 1; c <= n; c *= 10 {
        d++
    }
    //writer.WriteString(strconv.Itoa(c))
    c /= 10
    ans = (n - c + 1) * d;
    for d > 0 {
        ans += (c - c / 10) * (d-1);
        d--
        c /= 10
    }

    writer.WriteString(strconv.FormatInt(ans, 10))
    writer.Flush()
}

package main

import (
	"fmt"
)

func main() {
	var input uint64
	fmt.Scanf("%d", &input)
	digits := countDigits(input)
	rem := (input - pow10(digits-1) + 1) * digits
	res := uint64(0)
	for i := uint64(1); i < digits; i++ {
		res += (pow10(i) - pow10(i-1)) * i
	}
	fmt.Println(res + rem)
}

func pow10(n uint64) uint64 {
	if n == 0 {
		return 1
	} else {
		res := uint64(1)
		for ; n > 0; n-- {
			res *= 10
		}
		return res
	}
}

func countDigits(ub uint64) uint64 {
	count := uint64(0)
	for ; ub > 0; ub /= 10 {
		count++
	}
	return count
}

package main

import "fmt"

func main() {

    var n int64
    fmt.Scanf("%v\n", &n)
    var count int64 = 0;

    var i,x int64 = 9,1;

    for n > 0 {
        if n < i {
            count += n*x;
        } else {
            count += i*x;
        }
        n -= i
        i *= 10
        x++
    }
    fmt.Printf("%v\n",count)
}

package main

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

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

func count(n int64) int64 {
	if n < 10 {
		return int64(n)
	}
	var l, p int64 = 1, 1
	for p * 10 <= n {
		l++
		p *= 10
	}

	return l * (n / p) * (n % p + 1) + count(p - 1)
}

func main() {

	defer out.Flush()
	in.Split(bufio.ScanWords)

	fmt.Fprintln(out, count(NextInt64()))
}

func Next() string{
	if !in.Scan() {
		panic("Scan error")
	}
	return in.Text()
}

func NextInt() int{
	ret, _ := strconv.Atoi(Next())
	return ret
}

func NextInt64() int64 {
	ret, _ := strconv.ParseInt(Next(), 10, 64)
	return ret
}

package main

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

func main() {
    //io
    scanner := bufio.NewReader(os.Stdin)
    writer := bufio.NewWriter(os.Stdout)
    //---
    var n, d, c, ans int

    fmt.Fscan(scanner, &n)
    for c = 1; c <= n; c *= 10 {
        d++
    }
    //writer.WriteString(strconv.Itoa(c))
    c /= 10
    ans = (n - c + 1) * d;
    for d > 0 {
        ans += (c - c / 10) * (d-1);
        d--
        c /= 10
    }

    writer.WriteString(strconv.Itoa(ans))
    writer.Flush()
}

package main

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

func main() {
    //io
    scanner := bufio.NewReader(os.Stdin)
    writer := bufio.NewWriter(os.Stdout)
    //---
    var n, d, c, ans int

    fmt.Fscan(scanner, &n)
    for c = 1; c <= n; c *= 10 {
        d++
    }
    //writer.WriteString(strconv.Itoa(c))
    c /= 10
    b := d
    ans = (n - c) * d;
    for d > 0 {
        ans += (c - c / 10) * (b-d+1);
        d--
        c /= 10
    }

    writer.WriteString(strconv.Itoa(ans))
    writer.Flush()
}

package main

import (
	"fmt"
)

func main() {
	var input int
	fmt.Scanf("%d", &input)
	digits := countDigits(input)
	rem := (input - pow10(digits-1) + 1) * digits
	res := 0
	for i := 1; i < digits; i++ {
		res += (pow10(i) - pow10(i-1)) * i
	}
	fmt.Println(res + rem)
}

func pow10(n int) int {
	if n == 0 {
		return 1
	} else {
		res := 1
		for ; n > 0; n-- {
			res *= 10
		}
		return res
	}
}

func countDigits(ub int) int {
	count := 0
	for ; ub > 0; ub /= 10 {
		count++
	}
	return count
}

package main

import (
	"fmt"
)

func main() {
	var input int
	fmt.Scanf("%d", &input)
	digits := countDigits(input)
	rem := (input - pow10(digits-1) + 1) * digits
	res := 0
	for i := 1; i < digits; i++ {
		res += pow10(i) - 1
	}
	fmt.Println(res + rem)
}

func pow10(n int) int {
	if n == 0 {
		return 1
	} else {
		res := 1
		for ; n > 0; n-- {
			res *= 10
		}
		return res
	}
}

func countDigits(ub int) int {
	count := 0
	for ; ub > 0; ub /= 10 {
		count++
	}
	return count
}


You will receive 3 points for solving this problem.Manao is designing the genetic code for a new type of algae to efficiently produce fuel. Specifically, Manao is focusing on a stretch of DNA that encodes one protein. The stretch of DNA is represented by a string containing only the characters 'A', 'T', 'G' and 'C'.Manao has determined that if the stretch of DNA contains a maximal sequence of consecutive identical nucleotides that is of even length, then the protein will be nonfunctional. For example, consider a protein described by DNA string "GTTAAAG". It contains four maximal sequences of consecutive identical nucleotides: "G", "TT", "AAA", and "G". The protein is nonfunctional because sequence "TT" has even length.Manao is trying to obtain a functional protein from the protein he currently has. Manao can insert additional nucleotides into the DNA stretch. Each additional nucleotide is a character from the set {'A', 'T', 'G', 'C'}. Manao wants to determine the minimum number of insertions necessary to make the DNA encode a functional protein.

The input consists of a single line, containing a string s of length n (1 ≤ n ≤ 100). Each character of s will be from the set {'A', 'T', 'G', 'C'}. This problem doesn't have subproblems. You will get 3 points for the correct submission.

The program should print on one line a single integer representing the minimum number of 'A', 'T', 'G', 'C' characters that are required to be inserted into the input string in order to make all runs of identical characters have odd length.

NoteIn the first example, it is sufficient to insert a single nucleotide of any type between the two 'T's in the sequence to restore the functionality of the protein.

package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"os"
)

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)
	var s string
	fmt.Fscanf(reader, "%s", &s)
	count, ans := 1, 0
	for i := 1; i < len(s); i++ {
		if s[i] == s[i-1] {
			count++
		} else {
			count, ans = 1, ans+1-(count%2)
		}
	}
	ans = ans + 1 - (count % 2)
	fmt.Printf("%d", ans)

}

package main

import (
	"fmt"
	"bufio"
	"os"
	// "time"
)

func main() {
	// defer func(start time.Time) {
	// 	fmt.Println(time.Since(start))
	// }(time.Now())

	reader := bufio.NewReader(os.Stdin)

	var s string
	fmt.Fscan(reader, &s)
	var c uint8
	var index, count int

	// fmt.Println(s)
	for i:=0; i<len(s); i++ {
		c = s[i]
		index = 0
		for i++; i<len(s) && c==s[i]; i++ {
			index++
			// fmt.Printf("%c %d\n", s[i], i)
		}
		if index%2==1 {
			// fmt.Printf("count++ %c %d\n", c, index)
			count++
		}
		i--
	}

	fmt.Println(count)
}

//http://codeforces.com/problemset/problem/391/A
//A. Genetic Engineering
// az osszes futamot figyelni kell

package main

import (
	"fmt"
)

func main() {
	var (
		nd, i, run, ans int32
		d               string
		prev, akt       byte
	)

	fmt.Scan(&d)
	nd = int32(len(d))

	//	fmt.Println(d, nd)

	prev, run = d[0], 1

	for i = 1; i < nd; i++ {
		akt = d[i]
		if prev == akt {
			run++
		} else {
			if 0 == (run % 2) {
				ans++
			}
			prev = akt
			run = 1
		}
	}
	if 0 == (run % 2) {
		ans++
	}

	fmt.Println(ans)

}


You have an initially empty cauldron, and you want to brew a potion in it. The potion consists of two ingredients: magic essence and water. The potion you want to brew should contain exactly $$$k\ \%$$$ magic essence and $$$(100 - k)\ \%$$$ water.In one step, you can pour either one liter of magic essence or one liter of water into the cauldron. What is the minimum number of steps to brew a potion? You don't care about the total volume of the potion, only about the ratio between magic essence and water in it.A small reminder: if you pour $$$e$$$ liters of essence and $$$w$$$ liters of water ($$$e + w > 0$$$) into the cauldron, then it contains $$$\frac{e}{e + w} \cdot 100\ \%$$$ (without rounding) magic essence and $$$\frac{w}{e + w} \cdot 100\ \%$$$ water.

The first line contains the single $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The first and only line of each test case contains a single integer $$$k$$$ ($$$1 \le k \le 100$$$) — the percentage of essence in a good potion.

For each test case, print the minimum number of steps to brew a good potion. It can be proved that it's always possible to achieve it in a finite number of steps.

NoteIn the first test case, you should pour $$$3$$$ liters of magic essence and $$$97$$$ liters of water into the cauldron to get a potion with $$$3\ \%$$$ of magic essence.In the second test case, you can pour only $$$1$$$ liter of essence to get a potion with $$$100\ \%$$$ of magic essence.In the third test case, you can pour $$$1$$$ liter of magic essence and $$$3$$$ liters of water.

package main

import (
	"fmt"
)

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

	for ; t > 0; t-- {
		var k int
		fmt.Scanf("%d\n", &k)

		if k == 100 {
			fmt.Println(1)
		} else {
			curr := lcm(k, 100-k)
			fmt.Println(curr/k + curr/(100-k))
		}
	}
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

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

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 x float64
		fmt.Fscan(in,&x)
		if isIntegral(1/(x*0.01)) == true {
			fmt.Fprintln(out, int(1/(x*0.01)))
		} else {
			fmt.Fprintln(out,100/gcd(100,int(x)))
		}
	}
}
func isIntegral(val float64) bool {
	return val == float64(int(val))
}
func gcd(a,b int) int {
	if a<=b { // a smallest
		if b%a == 0 {
			return a
		} else {
			for i:=a/2;i>0;i--{
				if a%i == 0 {
					if b%i == 0 {
						return i
					}
				}
			}
		}
	} else {
		if a%b == 0 {
			return b
		} else {
			for i:=b/2;i>0;i--{
				if b%i == 0 {
					if a%i == 0 {
						return i
					}
				}
			}
		}
	}
	return 1
}

package main

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

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

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

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var k int
		fmt.Fscan(in, &k)

		fmt.Fprintln(out, 100/(gcd(k, 100)))
	}
}

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])
// }

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

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

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

func MAX(x, y int64) int64 {
	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 GCD(x, y int64) int64 {
	var l, q int64
	l = MAX(x, y)
	q = MIN(x, y)
	var m int64
	for l*q > 0 {
		a := l % q
		b := l - a
		cc := int64(b / q)
		remain := l - cc*q
		l = MAX(remain, q)
		q = MIN(remain, q)
		if l*q == 0 {
			m = l + q
			break
		}

	}
	return m

}

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
		}
	}

}

var t int

func main() {
	var input io.Reader = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &t)
	for o := 0; o < t; o++ {
		var k int
		fmt.Fscan(input, &k)
		m := 1
		if k%2 == 0 {
			m = m * 2
			k = int(k / 2)
		}
		if k%2 == 0 {
			m = m * 2
			k = int(k / 2)
		}
		if k%5 == 0 {
			m = m * 5
			k = int(k / 5)
		}
		if k%5 == 0 {
			m = m * 5
			k = int(k / 5)
		}
		fmt.Println(100 / m)

	}
}

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])
// }

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

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

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

func MAX(x, y int64) int64 {
	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 GCD(x, y int64) int64 {
	var l, q int64
	l = MAX(x, y)
	q = MIN(x, y)
	var m int64
	for l*q > 0 {
		a := l % q
		b := l - a
		cc := int64(b / q)
		remain := l - cc*q
		l = MAX(remain, q)
		q = MIN(remain, q)
		if l*q == 0 {
			m = l + q
			break
		}

	}
	return m

}

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
		}
	}

}

var t int

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

		if k == 100 {
			fmt.Println(1)
		} else {
			m := GCD(k, 100-k)
			sum := int(k/m) + int((100-k)/m)
			fmt.Println(sum)
		}

	}
}

package main

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

func main() {
	input := bufio.NewReader(os.Stdin)
	var T int
	_, err := fmt.Fscanln(input, &T)
	if err != nil {
		panic(err)
	}
	for k := 0; k < T; k++ {
		var x int
		_, err := fmt.Fscanln(input, &x)
		if err != nil {
			panic(err)
		}
		ans := 100
		for _, y := range ps {
			if x%y == 0 {
				x /= y
				ans /= y
			}
		}
		fmt.Println(ans)
	}
}

var (
	ps = []int{2, 2, 5, 5}
)

package main

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

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

func (in *CF1525A) 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 *CF1525A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

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

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

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

/**
Run solve the problem CF1525A
Date: 22/11/21
User: epradere
URL: https://codeforces.com/problemset/problem/1525/A
Problem: CF1525A
**/
func (in *CF1525A) Run() {
	for t := in.NextInt(); t > 0; t-- {
		magic := in.NextInt()
		water := 100 - magic
		div := Max(magic, water)
		ans := 0
		for {
			if magic%div == 0 && water%div == 0 {
				magic /= div
				water /= div
				div = Max(magic, water)
			} else {
				div--
			}
			if div == 1 {
				ans = magic + water
				break
			}
		}
		fmt.Println(ans)

	}
}

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

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

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

package main

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

var (
	reader = bufio.NewReader(os.Stdin)
	t, k   int
)

func gcd(x, y int) int {
	if x < y {
		x, y = y, x
	}
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

func solve(k int) int {
	g := gcd(k, 100-k)
	return 100 / g
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &k)
		fmt.Println(solve(k))
	}
}

package main

import "fmt"

//t = int(input())
//for _ in range(t):
//    k = int(input())
//    n = 100
//    while n != k:
//        if n > k:
//            n -= k
//        else:
//            k -= n
//    print(int(100 / k))

func main() {
	var t int
	fmt.Scanln(&t)
	for i := 0; i < t; i++ {
		var k int
		fmt.Scanln(&k)
		n := 100
		for n != k {
			if n > k {
				n -= k
			} else {
				k -= n
			}
		}
		fmt.Println(100 / k)
	}
}

// 要求essence达到特定百分比，但总量最少，本质上就是求essence与100的最大公约数，约掉。

package main

import (
	"fmt"
)

func main() {
	var t, k int
	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		fmt.Scan(&k)
		fmt.Println(100 / gcd(100, k))
	}
}

// 求最大公约数
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

package main

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

func min(a, b int) int {

	if a < b {
		return a
	}
	return b
}

func run(r io.Reader, w io.Writer) {

	in := bufio.NewReader(r)
	out := bufio.NewWriter(w)
	defer out.Flush()

	solve := func() {

		var n int

		fmt.Fscan(in, &n)

		fmt.Fprintln(out, 100 / gcd(n,100) )

	}

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

}

func main() {

	run(os.Stdin, os.Stdout)
}

func gcd(a, b int) int {
	for a != 0 {
		a, b = b%a, a
		//fmt.Println("a =>",a , "b =>",b)
	}
	return b
}

package main

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

func main() {

	r := bufio.NewReader(os.Stdin)

	var t int

	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		var k int

		fmt.Fscan(r, &k)

		ans := solve(k)

		fmt.Println(ans)

	}
}

func solve(k int) int {
	for j := 0; j <= 100; j++ {
		for p := 0; p <= 100; p++ {
			if j == 0 && p == 0 {
				continue
			}
			if 100 * j == k * (j + p) {
				return j + p
			}
		}
	}

	return -1
}

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 int
		Fscan(in, &n)
		g := gcd(n,100)
		Fprintln(out, 100/g)
	}

	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) }
func gcd(a, b int) int {
	for a != 0 {
		a, b = b%a, a
	}
	return b
}

package main

import (
	"fmt"
)

func main() {
	var t int
	fmt.Scan("%d", &t)

	for ; t > 0; t-- {
		var k int
		fmt.Scan("%d", &k)

		if k == 100 {
			fmt.Println(1)
		} else {
			curr := lcm(k, 100-k)
			fmt.Println(curr/k + curr/(100-k))
		}
	}
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

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

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 x float64
		fmt.Fscan(in,&x)
		if isIntegral(1/(x*0.01)) == true {
			fmt.Fprintln(out, int(1/(x*0.01)))
		} else {
			fmt.Fprintln(out,100)
		}
	}
}
func isIntegral(val float64) bool {
	return val == float64(int(val))
}

package main

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

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

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var k int
		fmt.Fscan(in, &k)

		if 100%k == 0 {
			fmt.Fprintln(out, 100/k)
		} else {
			fmt.Fprintln(out, 100)
		}
	}
}

package main

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

func main() {
	input := bufio.NewReader(os.Stdin)
	var T int
	_, err := fmt.Fscanln(input, &T)
	if err != nil {
		panic(err)
	}
	for k := 0; k < T; k++ {
		var x int
		_, err := fmt.Fscanln(input, &x)
		if err != nil {
			panic(err)
		}
		ans := 100
		for _, y := range ps {
			if x%y == 0 {
				ans /= y
			}
		}
		fmt.Println(ans)
	}
}

var (
	ps = []int{2, 2, 5, 5}
)


A prime number is a number which has exactly two distinct divisors: one and itself. For example, numbers 2, 7, 3 are prime, and 1, 6, 4 are not.The next prime number after x is the smallest prime number greater than x. For example, the next prime number after 2 is 3, and the next prime number after 3 is 5. Note that there is exactly one next prime number after each number. So 5 is not the next prime number for 2.One cold April morning Panoramix predicted that soon Kakofonix will break free from his straitjacket, and this will be a black day for the residents of the Gallic countryside.Panoramix's prophecy tells that if some day Asterix and Obelix beat exactly x Roman soldiers, where x is a prime number, and next day they beat exactly y Roman soldiers, where y is the next prime number after x, then it's time to wait for Armageddon, for nothing can shut Kakofonix up while he sings his infernal song.Yesterday the Gauls beat n Roman soldiers and it turned out that the number n was prime! Today their victims were a troop of m Romans (m > n). Determine whether the Gauls should wait for the black day after today's victory of Asterix and Obelix?

The first and only input line contains two positive integers — n and m (2 ≤ n < m ≤ 50). It is guaranteed that n is prime. Pretests contain all the cases with restrictions 2 ≤ n < m ≤ 4.

Print YES, if m is the next prime number after n, or NO otherwise.

package main

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

func main() {
	n, m := read2i()
	if isNextPrime(n, m) {
		fmt.Fprintln(writer, "YES")
	} else {
		fmt.Fprintln(writer, "NO")
	}
	writer.Flush()
}

func isNextPrime(n, m int) bool {
	for i := n + 1; i < m; i++ {
		if isPrime(i) {
			return false
		}
	}
	return isPrime(m)
}

func isPrime(n int) bool {
	for x := 2; x*x <= n; x++ {
		if n%x == 0 {
			return false
		}
	}
	return n > 1
}

func withSameCase(word string) string {
	lowerCount := 0
	for _, letter := range word {
		if unicode.IsLower(letter) {
			lowerCount++
		}
	}
	if lowerCount*2 >= len(word) {
		return strings.ToLower(word)
	}
	return strings.ToUpper(word)
}

func solve(matrix [][]int) []string {
	n := 3
	state := make([][]byte, n)
	for i := range state {
		state[i] = make([]byte, n)
		for j := range matrix[i] {
			state[i][j] = byte(matrix[i][j])
			if i > 0 {
				state[i][j] += byte(matrix[i-1][j])
			}
			if i+1 < n {
				state[i][j] += byte(matrix[i+1][j])
			}
			if j > 0 {
				state[i][j] += byte(matrix[i][j-1])
			}
			if j+1 < n {
				state[i][j] += byte(matrix[i][j+1])
			}
			state[i][j] &= 1
			state[i][j] ^= 1
			state[i][j] += '0'
		}
	}
	res := make([]string, n)
	for i := range res {
		res[i] = string(state[i])
	}
	return res
}

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

func abs64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

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

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

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

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

var (
	reader = bufio.NewReaderSize(os.Stdin, 1<<13)
	writer = bufio.NewWriterSize(os.Stdout, 1<<13)
)

func readi() int {
	return int(readi64())
}

func read2i() (int, int) {
	return readi(), readi()
}

func read3i() (int, int, int) {
	return readi(), readi(), readi()
}

func read4i() (int, int, int, int) {
	return readi(), readi(), readi(), readi()
}

func readis(n int) []int {
	res := make([]int, n)
	for i := range res {
		res[i] = readi()
	}
	return res
}

func readi64() int64 {
	b, err := reader.ReadByte()
	for !isValid(b, err) {
		b, err = reader.ReadByte()
	}
	sign, res := int64(1), int64(0)
	if b == '-' {
		sign *= -1
		b, err = reader.ReadByte()
	}
	for isValid(b, err) {
		res = res*10 + int64(b-'0')
		b, err = reader.ReadByte()
	}
	return res * sign
}

func readi64s(n int) []int64 {
	res := make([]int64, n)
	for i := range res {
		res[i] = readi64()
	}
	return res
}

func readline() string {
	res := new(bytes.Buffer)
	for {
		line, isPrefix, err := reader.ReadLine()
		if err != nil {
			panic(err)
		}
		res.Write(line)
		if !isPrefix {
			break
		}
	}
	return res.String()
}

func isValid(b byte, err error) bool {
	return err == nil && (('0' <= b && b <= '9') || b == '-')
}

package main

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

var scanner *bufio.Scanner

func getI64() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getI() int {
  return int(getI64())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

func main() {
  scanner = bufio.NewScanner(os.Stdin)
  scanner.Split(bufio.ScanWords)
  writer := bufio.NewWriter(os.Stdout)
  defer writer.Flush()

  n, m := getI(), getI()
  for true {
    n++
    divisible := false
    for a := 2; a*a <= n; a++ {
      if n%a == 0 {
        divisible = true
        break
      }
    }
    if !divisible {
      break
    }
  }
  result := "NO"
  if n == m {
    result = "YES"
  }
  writer.WriteString(fmt.Sprintf("%s\n", result))
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	integerWord, _ := reader.ReadString('\n')
	integerSufx := strings.TrimSuffix(integerWord, "\r\n")
	integers := strings.Split(integerSufx, " ")
	currentNum, _ := strconv.Atoi(integers[0])
	candidate, _ := strconv.Atoi(integers[1])
	out := "NO"
	for currentNum < candidate {
		currentNum++
		if isPrime(currentNum) {
			if currentNum == candidate {
				out = "YES"
				break
			} else {
				out = "NO"
				break
			}
		}
	}
	fmt.Print(out)
}

func isPrime(num int) (isPrime bool) {
	isPrime = true
	half := num / 2
	for index := 2; index <= half; index++ {
		if num%index == 0 {
			isPrime = false
			break
		}
	}
	return
}

package main

import (
	"fmt"
)

func main() {
	var n, m int
	if _, err := fmt.Scanf("%d %d\n", &n, &m); err != nil {
		return
	}

	numbers := make([]bool, m+1) // False for prime number
	numbers[1] = true
	numbers[2] = false
	numbers[3] = false
	for i := 2; i <= m; i++ {
		for j := 2; j <= m/i; j++ {
			numbers[i*j] = true
		}
	}

	if numbers[m] { // m is not prime
		fmt.Println("NO")
	} else {
		for i := n + 1; i < m; i++ {
			if !numbers[i] {
				fmt.Println("NO")
				return
			}
		}
		fmt.Println("YES")
	}
}

package main

import "fmt"

func main() {
    var n,m int
    fmt.Scan(&n,&m)
    ans := false
    for i := n+1; i <= m; i++ {
        prime := true
        for j := 2; j < i; j++ {
            if i%j == 0 { prime = false; break }
        }
        if prime {
            if i == m { ans = true }
            break
        }
    }
    if ans { fmt.Println("YES") } else { fmt.Println("NO") }
}

package main

import "fmt"

func main() {
    var n,m int                                 // membuat variabel n, m dengan tipe data int
    fmt.Scan(&n,&m)                             // menerima input nilai n dan m
    ans := false                                // membuat variabel ans dengan tipe bool dengan nilai awal false
    for i := n+1; i <= m; i++ {                 // looping sebanyak (m-n) kali (yaitu dari n+1 sampai m)
        prime := true                           // membuat variabel prime dengan tipe bool dengan nilai awal true
        for j := 2; j < i; j++ {                // looping dari j = 2 sampai j >= i (dari 2..(i-1))
            if i%j == 0 { prime = false; break }// jika i habis dibagi j, maka prime diubah menjadi false dan break
        }
        if prime {                              // jika nilai prime = true
            if i == m { ans = true }            // jika nilai i sama dengan nilai m, maka ans diubah menjadi true
            break                               // break dari looping
        }
    }
    if ans { fmt.Println("YES") } else { fmt.Println("NO") }  // jika nilai ans = true, maka cetak output "YES". Jika tidak, maka cetak output "NO"
}

package main

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

func main() {
	var n,m int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscanf(in, "%d %d\n", &n, &m)
	if check(n,m){
		fmt.Println("YES")
	}else{
		fmt.Println("NO")
	}
}
func check(n int, m int) bool{
	for i:= n + 1; i <= m; i++{
		if checkPrime(i) > 0{
			if i == m{
				return true
			}else{
				return false
			}
		}
	}
	return false
}
func checkPrime(a int) int{
	for k:= 2; k < a; k++{
		if a % k == 0{
			return -1
		}
	}
	return a
}

package main

import "fmt"

func main() {
	var n, m int
	fmt.Scan(&n, &m)

	is_prime := make([]int, 51, 51)
	for i := 0; i < 51; i++ {
		is_prime[i] = 1
	}
	is_prime[1] = 0
	for i := 2; i <= 8; i++ {
		if is_prime[i] == 1 {
			for x := i + i; x < 51; x += i {
				is_prime[x] = 0
			}
		}
	}

	ans := false
	for i := n + 1; i < 51; i++ {
		if is_prime[i] == 1 {
			if i == m {
				ans = true
			}
			break
		}
	}

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

// 80A-mic
package main

import (
    "fmt"
)

func main() {
    var l, cou, n, m int
    a := make([]int, 60)
    for i := 2; i < 55; i++ {
        for k := 1; k <= i; k++ {
            if i%k == 0 {
                cou++
            }

        }
        if cou == 2 {
            a[l] = i
            l++
            cou = 0
        }
        cou = 0

    }
    fmt.Scan(&n, &m)
    for i := 0; i < 55; i++ {
        if a[i] == n && a[i+1] == m {
            fmt.Println("YES")
            return
        }
    }
    fmt.Println("NO")
}

package main

import ("fmt")

type set map[int]bool
type long int64

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

func nextSimple(n int)int{
	spl := n + 1
	for !isSimple(spl){spl++}
	return spl
}

func main(){
	var n, m int
	scan(&n, &m)
	if nextSimple(n) == m{
		sout("YES")
	}else{
		sout("NO")
	}
}

func scan(in ... interface{}){
	for _,k := range in{
		fmt.Scan(k)
	}
}

func sout(obj ... interface{}){
	for _, k := range obj{
		fmt.Print(k)
	}
	fmt.Println()
}

package main

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

func main() {
	var n, m int
	fmt.Fscan(os.Stdin, &n, &m)
	i := n+1
	for i < m && !isPrime(i) { i++ }
	if i == m && isPrime(m) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

func isPrime(n int) bool {
	nf := float64(n)
	for i := 2.0; i <= math.Sqrt(nf); i++ {
		if n % int(i) == 0 { return false }
	}
	return true
}

// cf80a project main.go
package main

import (
	"fmt"
)

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	if od(n, m) == m {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}
func od(n, m int) int {
	for i := n + 1; i <= m; i++ {
		d := 0
		for j := 1; j <= i; j++ {
			if i%j == 0 {
				d++
			}
		}
		if d == 2 {
			return i
		}
	}
	return 0
}

package main

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

func main() {
	var n,m int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscanf(in, "%d %d\n", &n, &m)
	if check(n,m){
		fmt.Println("YES")
	}else{
		fmt.Println("NO")
	}
}
func check(n int, m int) bool{
	for i:= n + 1; i <= m; i++{
		if checkPrime(i) == m{
			return true
		}
	}
	return false
}
func checkPrime(a int) int{
	for k:= 2; k < a; k++{
		if a % k == 0{
			return -1
		}
	}
	return a
}

package main

import "fmt"

func main() {
	var n, m int
	fmt.Scan(&n, &m)

	is_prime := make([]int, 51, 51)
	for i := 0; i < 51; i++ {
		is_prime[i] = 1
	}
	is_prime[1] = 0
	for i := 2; i <= 8; i++ {
		if is_prime[i] == 1 {
			for x := i + i; x < 51; x += i {
				is_prime[x] = 0
			}
		}
	}

	ans := false
	for i := n + 1; i < 51; i++ {
		if is_prime[i] == 1 {
			if i == m {
				ans = true
			}
		}
	}

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


Alice has got addicted to a game called Sirtet recently.In Sirtet, player is given an $$$n \times m$$$ grid. Initially $$$a_{i,j}$$$ cubes are stacked up in the cell $$$(i,j)$$$. Two cells are called adjacent if they share a side. Player can perform the following operations:   stack up one cube in two adjacent cells;  stack up two cubes in one cell. Cubes mentioned above are identical in height.Here is an illustration of the game. States on the right are obtained by performing one of the above operations on the state on the left, and grey cubes are added due to the operation.  Player's goal is to make the height of all cells the same (i.e. so that each cell has the same number of cubes in it) using above operations. Alice, however, has found out that on some starting grids she may never reach the goal no matter what strategy she uses. Thus, she is wondering the number of initial grids such that   $$$L \le a_{i,j} \le R$$$ for all $$$1 \le i \le n$$$, $$$1 \le j \le m$$$;  player can reach the goal using above operations. Please help Alice with it. Notice that the answer might be large, please output the desired value modulo $$$998,244,353$$$.

Output one integer, representing the desired answer modulo $$$998,244,353$$$.

NoteIn the first sample, the only initial grid that satisfies the requirements is $$$a_{1,1}=a_{2,1}=a_{1,2}=a_{2,2}=1$$$. Thus the answer should be $$$1$$$.In the second sample, initial grids that satisfy the requirements are $$$a_{1,1}=a_{1,2}=1$$$ and $$$a_{1,1}=a_{1,2}=2$$$. Thus the answer should be $$$2$$$.

package main

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

const mod =  998244353
var n, m, L, R int

func pw(a int64, b int64) int64 {
	if a == 0 {
		if b == 0 {
			return 1
		}
		return 0
	}
	var ret = int64(1)

	for b > 0 {
		if (b & 1) == 1 {
			ret = ret * a % mod
			b--
		} else {
			a = a * a % mod
			b /= 2
		}
	}
	return ret
}

func main()  {
	var reader = bufio.NewReader(os.Stdin)
	var writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	fmt.Fscanf(reader, "%d %d %d %d", &n, &m, &L, &R)

	var diff = R - L + 1
	var odd = diff / 2
	var evn = diff / 2

	if diff % 2 != 0 {
		if L % 2 == 0 {
			evn++
		} else {
			odd++
		}
	}

	var T = int64(n) * int64(m)

	var ret = pw(int64(evn + odd), T)
	ret = (ret + pw(int64(evn - odd + mod), T)) % mod

	if ret < 0 {
		ret += mod
	}

	if T % 2 == 1 {
		evn, odd = odd, evn
		ret += pw(int64(evn + odd), T)
		ret %= mod
		ret += pw(int64(evn - odd + mod), T)
		ret %= mod
	}

	ret = ret * pw(2, mod - 2) % mod
	fmt.Fprintf(writer, "%d", ret)
}

package main

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

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

const mod =  998244353
const N = 2
var n, m, L, R int

type matrix struct {
	f[N][N] int64
}

func print_out(a matrix)  {
	for i := 0; i < N; i++ {
		for j := 0; j < N; j++ {
			fmt.Fprintf(writer, "%d ", a.f[i][j])
		}
		fmt.Fprintf(writer, "\n")
	}
}

func mul(a matrix, b matrix) matrix {
	var c = matrix{}
	for i := 0; i < N; i++ {
		for j := 0; j < N; j++ {
			for k := 0; k < N; k++ {
				c.f[i][j] += a.f[i][k] * b.f[k][j]
				c.f[i][j] %= mod
			}
		}
	}
	return c
}

func pw(a matrix, b int64) matrix {
	var ret = matrix{}
	for i := 0; i < N; i++ {
		ret.f[i][i] = 1
	}

	for b > 0 {
		if (b & 1) == 1 {
			ret = mul(ret, a)
			b--
		} else {
			a = mul(a, a)
			b /= 2
		}
	}
	return ret
}

func main()  {
	defer writer.Flush()
	fmt.Fscanf(reader, "%d %d %d %d", &n, &m, &L, &R)

	var O = int64(R - L + 1) / 2
	var E = int64(R - L + 1) / 2
	if (R - L + 1) % 2 != 0 {
		if L%2 == 0 {
			E++
		} else {
			O++
		}
	}

	var T = int64(n) * int64(m)

	var mt = matrix{}
	mt.f[0][0] = E
	mt.f[0][1] = O
	mt.f[1][0] = O
	mt.f[1][1] = E

	//print_out(mt)

	mt = pw(mt, T - 1)

	//print_out(mt)

	var dp_odd = O
	var dp_evn = E

	var fn_dp_odd = mt.f[0][0] * dp_odd % mod + mt.f[1][0] * dp_evn % mod
	fn_dp_odd %= mod

	var fn_dp_evn = mt.f[1][0] * dp_odd % mod + mt.f[1][1] * dp_evn % mod
	fn_dp_evn %= mod

	var ret int64
	if T % 2 == 1 {
		ret = (fn_dp_odd + fn_dp_evn) % mod
	} else {
		ret = fn_dp_evn
	}

	fmt.Fprintf(writer, "%d", ret)
}

package main

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

const mod =  998244353
var n, m, L, R int

func pw(a int, b int) int {
	if a == 0 {
		if b == 0 {
			return 1
		}
		return 0
	}
	var ret = 1
	for b > 0 {
		if (b & 1) == 1 {
			ret = int(int64(ret) * int64(a) % mod)
			b--
		} else {
			a = int(int64(a) * int64(a) % mod)
			b /= 2
		}
	}
	return ret
}

func main()  {
	var reader = bufio.NewReader(os.Stdin)
	var writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	fmt.Fscanf(reader, "%d %d %d %d", &n, &m, &L, &R)

	var diff = R - L + 1
	var odd = diff / 2
	var evn = diff / 2

	if diff % 2 != 0 {
		if L % 2 == 0 {
			evn++
		} else {
			odd++
		}
	}

	var T = int(int64(n) * int64(m) % (mod - 1))
	var ret = pw(evn + odd, T)
	ret = (ret + pw(evn - odd + mod, T)) % mod

	if ret < 0 {
		ret += mod
	}

	if int64(n) * int64(m) % 2 == 1 {
		evn, odd = odd, evn
		ret += pw(evn + odd, T)
		ret %= mod
		ret += pw(evn - odd + mod, T)
		ret %= mod
	}

	ret = int(int64(ret) * int64(pw(2, mod - 2)) % mod)
	fmt.Fprintf(writer, "%d", ret)
}

package main

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

const mod =  998244353
var n, m, L, R int

func pw(a int, b int) int {
	if a == 0 {
		if b == 0 {
			return 1
		}
		return 0
	}
	var ret = 1
	for b > 0 {
		if (b & 1) == 1 {
			ret = int(int64(ret) * int64(a) % mod)
			b--
		} else {
			a = int(int64(a) * int64(a) % mod)
			b /= 2
		}
	}
	return ret
}

func main()  {
	var reader = bufio.NewReader(os.Stdin)
	var writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	fmt.Fscanf(reader, "%d %d %d %d", &n, &m, &L, &R)

	var diff = R - L + 1
	var odd = diff / 2
	var evn = diff / 2

	if diff % 2 != 0 {
		if L % 2 == 0 {
			evn++
		} else {
			odd++
		}
	}

	var T = int(int64(n) * int64(m) % (mod - 1))
	var ret = pw(evn + odd, T)
	ret = (ret + pw(evn - odd, T)) % mod

	if ret < 0 {
		ret += mod
	}

	ret = int(int64(ret) * int64(pw(2, mod - 2)) % mod)
	fmt.Fprintf(writer, "%d", ret)
}

package main

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

const mod =  998244353
var n, m, L, R int

func pw(a int, b int) int {
	if a == 0 {
		if b == 0 {
			return 1
		}
		return 0
	}
	var ret = 1
	for b > 0 {
		if (b & 1) == 1 {
			ret = int(int64(ret) * int64(a) % mod)
			b--
		} else {
			a = int(int64(a) * int64(a) % mod)
			b /= 2
		}
	}
	return ret
}

func main()  {
	var reader = bufio.NewReader(os.Stdin)
	var writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	fmt.Fscanf(reader, "%d %d %d %d", &n, &m, &L, &R)

	var diff = R - L + 1
	var odd = diff / 2
	var evn = diff / 2

	if diff % 2 != 0 {
		if L % 2 == 0 {
			evn++
		} else {
			odd++
		}
	}

	var T = int(int64(n) * int64(m) % (mod - 1))
	var ret = pw(evn + odd, T)
	ret = (ret + pw(evn - odd, T)) % mod

	if ret < 0 {
		ret += mod
	}

       // review
	ret = int(int64(ret) * int64(pw(2, mod - 2)) % mod)
	fmt.Fprintf(writer, "%d", ret)
}